login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A209229 Characteristic function of powers of 2, cf. A000079. 88
0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

Essentially the same as A036987 (the Fredholm-Rueppel sequence).

Completely multiplicative with a(2^e) = 1, a(p^e) = 0 for odd primes p. - Mitch Harris, Apr 19 2005

Moebius transform of A001511. - R. J. Mathar, Jun 20 2014

REFERENCES

Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..65537 (terms 0..1000 from G. C. Greubel)

Index entries for characteristic functions

Index to divisibility sequences

FORMULA

a(A000079(n)) = 1; a(A057716(n)) = 0.

a(n+1) = A036987(n).

a(n) = if n < 2 then n else (if n is even then a(n/2) else 0).

The generating function g(x) satisfies g(x) - g(x^2) = x. - Joerg Arndt, May 11 2010

Dirichlet g.f.: 1/(1 - 2^(-s)). - R. J. Mathar, Mar 07 2012

G.f.: x / (1 - x / (1 + x / (1 + x / (1 - x / (1 + x / (1 - x / ...)))))) = x / (1 + b(1) * x / (1 + b(2) * x / (1 + b(3) * x / ...))) where b(n) = (-1)^ A090678(n+1). - Michael Somos, Jan 03 2013

With a(0) = 0 removed is convolution inverse of A104977. - Michael Somos, Jan 03 2013

From Antti Karttunen, Nov 19 2017: (Start)

a(n) = abs(A154269(n)).

For n > 1, a(n) = A069517(n)/2 = 2 - A201219(n). (End)

EXAMPLE

x + x^2 + x^4 + x^8 + x^16 + x^32 + x^64 + x^128 + x^256 + x^512 + x^1024 + ...

MATHEMATICA

a[n_] := Boole[n == 2^IntegerExponent[n, 2]]; Table[a[n], {n, 0, 100}] (* Jean-Fran├žois Alcover, May 06 2014 *)

Table[If[IntegerQ[Log[2, n]], 1, 0], {n, 0, 100}] (* Harvey P. Dale, Jun 24 2018 *)

PROG

(Haskell)

a209229 n | n < 2 = n

          | n > 1 = if m > 0 then 0 else a209229 n'

          where (n', m) = divMod n 2

(PARI) a(n)=n==1<<valuation(n, 2) \\ Charles R Greathouse IV, Mar 07 2012

(C) int a (unsigned long n) { return n & !(n & (n-1)); } /* Charles R Greathouse IV, Sep 15 2012 */

(PARI) {a(n) = if( n<2 || n%2, n==1, isprimepower(n) > 0)} /* Michael Somos, Jan 03 2013

CROSSREFS

Cf. A001511, A029837 (partial sums), A087003 (moebius transform), A090678, A104977, A154955 (inverse Dirichlet transform).

Cf. A069517, A154269, A201219, A255738.

Sequence in context: A079336 A057215 A029691 * A156595 A143222 A010060

Adjacent sequences:  A209226 A209227 A209228 * A209230 A209231 A209232

KEYWORD

nonn,mult,easy

AUTHOR

Reinhard Zumkeller, Mar 06 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 17 21:47 EDT 2018. Contains 316297 sequences. (Running on oeis4.)