login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A329162 a(n) = Sum_{k<n} ((2^n-1) mod (2^k-1)). 1
0, 0, 1, 1, 5, 4, 13, 14, 28, 30, 69, 60, 131, 144, 263, 267, 549, 530, 1077, 1100, 2085, 2140, 4301, 4186, 8364, 8558, 16623, 16744, 33515, 33164, 66357, 66936, 131849, 132656, 265187, 263571, 527177, 530100, 1052039, 1054214, 2108467, 2103240, 4206521, 4216716, 8400159, 8411752, 16823549 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
n is prime if and only if a(n) = 2*a(n-1) + n - 2.
LINKS
FORMULA
a(n) = Sum_{k<n} (2^(n mod k) - 1).
G.f.: Sum_{k>=1} ((2^k-2)*z^(2*k+1)+(1-2^k)*z^(2*k)+z^(k+1))/((1-z^k)*(1-z)*(1-2*z)).
EXAMPLE
2^5-1 == 0 (mod 2^1-1), == 1 (mod 2^2-1), == 3 (mod 2^3-1), == 1 (mod 2^4-1), so a(5) = 0+1+3+1 = 5.
MAPLE
f:= proc(n) local k;
add(2^(n mod k) - 1, k=2..n-1)
end proc:
map(f, [$1..100]);
PROG
(Magma) [0] cat [&+[2^(n mod k)-1:k in [1..n-1]]:n in [2..50]]; // Marius A. Burtea, Nov 06 2019
CROSSREFS
Sequence in context: A147685 A353151 A078930 * A344817 A094414 A158867
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Nov 06 2019
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)