login
A079355
a(1) = 1; a(n) = a(n-1)-3 if n is already in the sequence, a(n) = a(n-1)+4 otherwise.
2
1, 5, 9, 13, 10, 14, 18, 22, 19, 16, 20, 24, 21, 18, 22, 19, 23, 20, 17, 14, 11, 8, 5, 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 35, 32, 36, 40, 37, 41, 38, 35, 39, 43, 47, 51, 55, 52, 56, 60, 64, 61, 58, 62, 66, 63, 60, 64, 61, 65, 62, 59, 56, 53, 50, 47, 44, 48, 52, 56, 60, 64, 68
OFFSET
1,2
FORMULA
a(n) = n+b(n)-22 where b(n) is the 42-periodic sequence (22, 25, 28, 31, 27, 30, 33, 36, 32, 28, 31, 34, 30, 26, 29, 25, 28, 24, 20, 16, 12, 8, 4, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 23, 19, 22, 25, 21, 24, 20, 16, 19)
a(n) = +a(n-1) +a(n-42) -a(n-43). - R. J. Mathar, Mar 16 2026
MAPLE
A079355 := proc(n)
option remember ;
if n =1 then
1;
else
fnd := false ;
for j from 1 to n-1 do
if procname(j) = n then
fnd := true ;
break ;
end if;
end do;
if fnd then
procname(n-1)-3 ;
else
procname(n-1)+4 ;
end if;
end if;
end proc:
seq(A079355(n), n=1..100) ; # R. J. Mathar, Mar 16 2026
MATHEMATICA
A079355list[nmax_] := Module[{s, a}, s[_] := False; s[1] = True; FoldList[(s[a = # + If[s[#2], -3, 4]] = True; a) &, Range[nmax]]];
A079355list[100] (* or *)
A079355[n_] := n + {19, 22, 25, 28, 31, 27, 30, 33, 36, 32, 28, 31, 34, 30, 26, 29, 25, 28, 24, 20, 16, 12, 8, 4, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 23, 19, 22, 25, 21, 24, 20, 16}[[Mod[n, 42] + 1]] - 22;
Array[A079355, 100] (* Paolo Xausa, Mar 25 2026 *)
CROSSREFS
Cf. A079357.
Sequence in context: A277617 A103703 A143706 * A080781 A079357 A080455
KEYWORD
nonn,hear,easy
AUTHOR
Benoit Cloitre, Feb 14 2003
STATUS
approved