OFFSET
1,4
COMMENTS
Write the positive integers with two spaces between each integer: 1,_,_,2,_,_,3,_,_,4,_,_,5,_,_,6,..., and fill undefined places with the sequence itself. A003602 is obtained by starting from 1,_,2,_,3,_,4,_,5,_,6,....
From Peter Munn, Aug 02 2020: (Start)
a(n) - 1 is the row of A083044 in which n occurs.
The m-th occurrence of m is at position A083045(m-1).
(End)
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
a(3n-2) = n.
From Rémy Sigrist, Jan 15 2021: (Start)
a(n+ceiling(n/2)) = a(n).
a(n) = 1 iff n belongs to A061419.
(End)
a(n) = (n+2)/3 if n == 1 (mod 3), otherwise a(n) = a(floor(n*2/3)). - Michael S. Branicky and Kevin Ryde, Jan 16 2021
EXAMPLE
1,_,_,2,_,_,3,_,_,4,... -->
1,1,_,2,_,_,3,_,_,4,... -->
1,1,1,2,_,_,3,_,_,4,... -->
1,1,1,2,1,_,3,_,_,4,... -->
1,1,1,2,1,2,3,_,_,4,... -->
1,1,1,2,1,2,3,_,_,4,... -->
1,1,1,2,1,2,3,1,_,4,... -->
1,1,1,2,1,2,3,1,2,4,... -->
...
MATHEMATICA
a[n_] := a[n] = If[Mod[n, 3] == 1, (n+2)/3, a[Floor[2n/3]]];
Array[a, 100] (* Jean-François Alcover, Jan 10 2022 *)
PROG
(Python)
def a(n): return (n+2)//3 if n%3==1 else a(n*2//3)
print([a(n) for n in range(1, 78)]) # Michael S. Branicky, Jan 16 2021
(PARI) a(n) = n+=2; my(q, r); while([q, r]=divrem(n, 3); r, n-=q); q; \\ Kevin Ryde, Jan 16 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Jul 29 2009
EXTENSIONS
Terms after a(70) corrected by Jon E. Schoenfield, Nov 26 2015
STATUS
approved