A048298 a(n) = n if n=2^i for i >= 0, otherwise a(n) = 0.
0, 1, 2, 0, 4, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Jean-Paul Allouche and Jeffrey Shallit, The Ring of k-regular Sequences, II.
- Jean-Paul Allouche and Jeffrey Shallit, The ring of k-regular sequences, II, Theoret. Computer Sci., 307 (2003), 3-29.
- Daniele A. Gewurz and Francesca Merola, Sequences realized as Parker vectors of oligomorphic permutation groups, J. Integer Seqs., Vol. 6, 2003.
Crossrefs
Programs
-
Haskell
a048298 n = a209229 n * n -- Reinhard Zumkeller, Oct 17 2015
-
Magma
[n eq 2^Valuation(n,2) select n else 0: n in [0..120]]; // Vincenzo Librandi, improved by Bruno Berselli, Mar 27 2015
-
Maple
0, seq(op([2^n,0$(2^n-1)]), n=0..10); # Robert Israel, Mar 25 2015 a := n -> if n = 2^ilog2(n) then n else 0 fi: # Peter Luschny, Oct 03 2022
-
Mathematica
Table[n*Boole[Or[n == 1, First /@ FactorInteger@ n == {2}]], {n, 0, 120}] (* Michael De Vlieger, Mar 25 2015 *) a[n_] := If[n == 2^IntegerExponent[n, 2], n, 0]; Array[a, 100, 0] (* Amiram Eldar, Oct 10 2023 *)
-
PARI
a(n)=direuler(p=1,n,if(p==2,1/(1-2*X),1))[n] /* Ralf Stephan, Mar 27 2015 */
-
PARI
a(n) = if(n == 0, 0, if(n == 1 << valuation(n, 2), n, 0)); \\ Amiram Eldar, Oct 10 2023
-
Python
def A048298(n): return n if n and not(n&-n)^n else 0 # Chai Wah Wu, Dec 01 2022
Formula
Multiplicative with a(2^e)=2^e and a(p^e)=0 for p > 2. - Vladeta Jovovic, Jan 27 2002
Inverse mod 2 binomial transform of n. a(n) = sum{k=0..n, (-1)^A010060(n-k)*mod(C(n, k), 2)*k}. - Paul Barry, Jan 03 2005
If n=1 we have a(n)=1; if n=p is prime, then (-1)^(p+1)+a(p)=1, thus a(2)=2, and a(p)=0, if p>2. - Vladimir Shevelev, Jun 09 2009
Dirichlet g.f.: 2^s/(2^s-2). - Ralf Stephan, Jun 17 2007
Dirichlet g.f.: zeta(s)/eta(s). - Ralf Stephan, Mar 25 2015
For n>=1, we have a recursion Sum_{d|n}(-1)^(1+(n/d))a(d)=1. - Vladimir Shevelev, Jun 09 2009
For n>=1, there is the recurrence n=Sum_{k=1..n} a(k)*g(n/k) where g(x) = floor(x) - 2*floor(x/2). - Benoit Cloitre, Nov 11 2010
a(n) = A209229(n)*n. - Reinhard Zumkeller, Oct 17 2015
a(n) = n if 2^n mod n == 0 and a(n) = 0 otherwise. - Chai Wah Wu, Dec 01 2022
Extensions
More terms from Keiko L. Noble (s1180624(AT)cedarville.edu)
Comments