login
A214392
If n mod 4 = 0 then a(n) = n/4, otherwise a(n) = n.
4
0, 1, 2, 3, 1, 5, 6, 7, 2, 9, 10, 11, 3, 13, 14, 15, 4, 17, 18, 19, 5, 21, 22, 23, 6, 25, 26, 27, 7, 29, 30, 31, 8, 33, 34, 35, 9, 37, 38, 39, 10, 41, 42, 43, 11, 45, 46, 47, 12, 49, 50, 51, 13, 53, 54, 55, 14, 57, 58
OFFSET
0,3
COMMENTS
Equivalent to A065883 for n mod 16 != 0. - Peter Kagey, Sep 02 2015
FORMULA
From Bruno Berselli, Oct 16 2012: (Start)
G.f.: x*(1+2*x+3*x^2+x^3+3*x^4+2*x^5+x^6)/(1-x^4)^2.
a(n) = ( 1 - (3/16)*(1+(-1)^n)*(1+i^(n(n+1))) )*n, where i=sqrt(-1).
a(n) = a(-n) = 2*a(n-4) - a(n-8). (End)
From Werner Schulte, Jul 08 2018: (Start)
a(n) for n > 0 is multiplicative with a(2^e) = 2^e if e < 2 and a(2^e) = 2^(e-2) if e > 1 otherwise a(p^e) = p^e for prime p > 2 and e >= 0.
Dirichlet g.f.: Sum_{n>0} a(n)/n^s = (1-3/4^s)*zeta(s-1).
Dirichlet inverse b(n) is multiplicative with b(2^e) = (-1)^e * A038754(e), e >= 0, and for prime p > 2: b(p) = -p and b(p^e) = 0 if e > 1. (End)
Sum_{k=1..n} a(k) ~ (13/32) * n^2. - Amiram Eldar, Nov 28 2022
EXAMPLE
a(16) = 16/4 = 4;
a(17) = 17.
MATHEMATICA
Table[If[Mod[n, 4] == 0, n/4, n], {n, 0, 50}] (* G. C. Greubel, Oct 26 2017 *)
LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {0, 1, 2, 3, 1, 5, 6, 7}, 60] (* Harvey P. Dale, Mar 30 2018 *)
PROG
(PARI) a(n)=if(n%4, n, n/4) \\ Charles R Greathouse IV, Oct 16 2015
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Jeremy Gardiner, Jul 15 2012
STATUS
approved