login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A350168
Count from 0 to 1st prime 2, then from 0 to 2nd prime 3, then from 0 to 3rd prime 5, etc ...
1
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, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
OFFSET
1,3
LINKS
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
Cf. A008864 (row lengths), A002260, A002262.
Sequence in context: A298486 A189768 A362327 * A262881 A336820 A099173
KEYWORD
nonn,tabf
AUTHOR
Michel Marcus, Dec 18 2021
STATUS
approved