OFFSET
1,3
LINKS
Winston de Greef, Table of n, a(n) of the first 150 rows, flattened (n = 1..11326)
Jean-Paul Delahaye, Des suites fractales d’entiers, Pour la Science, No. 531 January 2022. Sequence a) p. 82.
EXAMPLE
As a triangle, this begins:
[0, 1, 2]
[0, 1, 2, 3]
[0, 1, 2, 3, 4, 5]
[0, 1, 2, 3, 4, 5, 6, 7]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
...
MAPLE
a:=[];
for n from 1 to 12 do
t1:=[seq(i, i=0..ithprime(n))];
lprint(t1);
a:=[op(a), op(t1)];
od:
a; # N. J. A. Sloane, Dec 18 2021
MATHEMATICA
Range[0, Prime[Range[10]]]//Flatten (* Harvey P. Dale, Oct 19 2022 *)
PROG
(Python)
from sympy import prime
from itertools import count, islice
def agen():
for i in count(1):
yield from range(prime(i) + 1)
print(list(islice(agen(), 80))) # Michael S. Branicky, Dec 18 2021
(PARI)
row(n)=vector(prime(n)+1, i, i-1)
a(n)=n-=1; forprime(p=1, oo, if(p >= n, break, n-=p+1)); n \\ Winston de Greef, Jun 27 2024
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Michel Marcus, Dec 18 2021
STATUS
approved