OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = 5+(-1)^n+3*cos(n*Pi/2)-3*sin(n*Pi/2)+10*(prime(floor((n+3)/4)) mod 10). - Wesley Ivan Hurt, May 06 2021
MATHEMATICA
Flatten[Table[Mod[Prime[n], 10]*10+{1, 3, 7, 9}, {n, 1, 50}]]
a[n_] := Mod[Prime[Floor[(n + 3)/4]], 10]*10 + {1, 3, 7,
9}[[Mod[n - 1, 4] + 1]] (* Charles R Greathouse IV, Jan 02 2013 *)
Table[10*Mod[Prime[n], 10]+{1, 3, 7, 9}, {n, 30}]//Flatten (* Harvey P. Dale, Aug 24 2019 *)
PROG
(PARI) a(n)=prime((n+3)\4)%10*10+[9, 1, 3, 7][n%4+1] \\ Charles R Greathouse IV, Jan 02 2013
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Roger L. Bagula, Jan 09 2004
STATUS
approved