login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A239904 a(n) = n - wt(n) + (number of times 11 appears in binary expansion of n). 3
0, 0, 1, 2, 3, 3, 5, 6, 7, 7, 8, 9, 11, 11, 13, 14, 15, 15, 16, 17, 18, 18, 20, 21, 23, 23, 24, 25, 27, 27, 29, 30, 31, 31, 32, 33, 34, 34, 36, 37, 38, 38, 39, 40, 42, 42, 44, 45, 47, 47, 48, 49, 50, 50, 52, 53, 55, 55, 56, 57, 59, 59, 61, 62, 63, 63, 64, 65, 66, 66, 68, 69, 70, 70, 71, 72, 74, 74, 76 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

This is G_{2, 1/4}(n) in Prodinger's notation.

LINKS

Gheorghe Coserea, Table of n, a(n) for n = 0..10000

Helmut Prodinger, Generalizing the sum of digits function, SIAM J. Algebraic Discrete Methods 3 (1982), no. 1, 35--42. MR0644955 (83f:10009).

FORMULA

a(n) = n - A000120(n) + A014081(n).

MAPLE

A000120 := proc(n) add(i, i=convert(n, base, 2)) end:

# A014081:

cn := proc(v, k) local n, s, nn, i, j, som, kk;

som := 0;

kk := convert(cat(seq(1, j = 1 .. k)), string);

n := convert(v, binary);

s := convert(n, string);

nn := length(s);

for i to nn - k + 1 do

if substring(s, i .. i + k - 1) = kk then som := som + 1 fi od;

som; end;

[seq(n-A000120(n)+cn(n, 2), n=0..100)];

MATHEMATICA

cn[n_, k_] := Count[Partition[IntegerDigits[n, 2], k, 1], Table[1, {k}]]; Table[n - DigitCount[n, 2, 1] + cn[n, 2], {n, 0, 78}] (* Michael De Vlieger, Sep 18 2015 *)

PROG

(PARI)

a(n) = n - hammingweight(n) + hammingweight(bitand(n, n>>1));

vector(79, i, a(i-1))  \\ Gheorghe Coserea, Sep 24 2015

CROSSREFS

Cf. A000120, A014081, A239906, A239907.

Sequence in context: A081210 A285719 A070321 * A334819 A220838 A236294

Adjacent sequences:  A239901 A239902 A239903 * A239905 A239906 A239907

KEYWORD

nonn,base

AUTHOR

N. J. A. Sloane, Apr 06 2014

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 27 21:52 EDT 2020. Contains 334671 sequences. (Running on oeis4.)