[go: up one dir, main page]

login
Search: a001227 -id:a001227
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) = Sum_{k=1..n} (number of odd divisors of k) (cf. A001227).
+20
35
0, 1, 2, 4, 5, 7, 9, 11, 12, 15, 17, 19, 21, 23, 25, 29, 30, 32, 35, 37, 39, 43, 45, 47, 49, 52, 54, 58, 60, 62, 66, 68, 69, 73, 75, 79, 82, 84, 86, 90, 92, 94, 98, 100, 102, 108, 110, 112, 114, 117, 120, 124, 126, 128, 132, 136, 138, 142, 144, 146, 150, 152, 154, 160
OFFSET
0,3
COMMENTS
The old definition was "Number of sums less than or equal to n of sequences of consecutive positive integers (including sequences of length 1)."
In other words, a(n) is also the total number of partitions of all positive integers <= n into consecutive parts, n >= 1. - Omar E. Pol, Dec 03 2020
Starting with 1 = row sums of triangle A168508. - Gary W. Adamson, Nov 27 2009
The subsequence of primes in this sequence begins, through a(100): 2, 5, 7, 11, 17, 19, 23, 29, 37, 43, 47, 73, 79, 173, 181, 223, 227, 229, 233, 263. - Jonathan Vos Post, Feb 13 2010
Apart from the initial zero, a(n) is also the total number of subparts of the symmetric representations of sigma of all positive integers <= n. Hence a(n) is also the total number of subparts in the terraces of the stepped pyramid with n levels described in A245092. For more information see A279387 and A237593. - Omar E. Pol, Dec 17 2016
a(n) is also the total number of partitions of all positive integers <= n into an odd number of equal parts. - Omar E. Pol, May 14 2017
Zero together with the row sums of A235791. - Omar E. Pol, Dec 18 2020
LINKS
FORMULA
a(n) = Sum_{i=1..n} A001227(i).
a(n) = a(n-1) + A001227(n).
a(n) = n + floor(n/3) + floor(n/5) + floor(n/7) + floor(n/9) + ...
a(n) = A006218(n) - A006218(floor(n/2)).
a(n) = Sum_{i=1..ceiling(n/2)} A000005(n-i+1). - Wesley Ivan Hurt, Sep 30 2013
a(n) = Sum_{i=floor((n+2)/2)..n} A000005(i). - N. J. A. Sloane, Dec 06 2020, modified by Xiaohan Zhang, Nov 07 2022
G.f.: (1/(1 - x))*Sum_{k>=1} x^k/(1 - x^(2*k)). - Ilya Gutkovskiy, Dec 23 2016
a(n) ~ n*(log(2*n) + 2*gamma - 1) / 2, where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, Jan 30 2019
EXAMPLE
E.g., for a(7), we consider the odd divisors of 1,2,3,4,5,6,7, which gives 1,1,2,1,2,2,2 = 11. - Jon Perry, Mar 22 2004
Example illustrating the old definition: a(7) = 11 since 1, 2, 3, 4, 5, 6, 7, 1+2, 2+3, 3+4, 1+2+3 are all 7 or less.
From Omar E. Pol, Dec 02 2020: (Start)
Illustration of initial terms:
Diagram
n a(n)
0 0 _|
1 1 _|1|
2 2 _|1 _|
3 4 _|1 |1|
4 5 _|1 _| |
5 7 _|1 |1 _|
6 9 _|1 _| |1|
7 11 _|1 |1 | |
8 12 _|1 _| _| |
9 15 _|1 |1 |1 _|
10 17 _|1 _| | |1|
11 19 _|1 |1 _| | |
12 21 |1 | |1 | |
...
a(n) is also the total number of horizontal line segments in the first n levels of the diagram. For n = 5 there are seven horizontal line segments, so a(5) = 7. Cf. A237048, A286001. (End)
From Omar E. Pol, Dec 19 2020: (Start)
a(n) is also the number of regions in the diagram of the symmetries of sigma after n stages, including the subparts, as shown below (Cf. A279387):
. _ _ _ _
. _ _ _ |_ _ _ |_
. _ _ _ |_ _ _| |_ _ _| |_|_
. _ _ |_ _ |_ |_ _ |_ _ |_ _ |_ _ |
. _ _ |_ _|_ |_ _|_ | |_ _|_ | | |_ _|_ | | |
. _ |_ | |_ | | |_ | | | |_ | | | | |_ | | | | |
. |_| |_|_| |_|_|_| |_|_|_|_| |_|_|_|_|_| |_|_|_|_|_|_|
.
. 0 1 2 4 5 7 9
(End)
MAPLE
A060831 := proc(n)
add(numtheory[tau](n-i+1), i=1..ceil(n/2)) ;
end proc:
seq(A060831(n), n=0..100) ; # Wesley Ivan Hurt, Oct 02 2013
MATHEMATICA
f[n_] := Sum[ -(-1^k)Floor[n/(2k - 1)], {k, n}]; Table[ f[n], {n, 0, 65}] (* Robert G. Wilson v, Jun 16 2006 *)
Accumulate[Table[Count[Divisors[n], _?OddQ], {n, 0, 70}]] (* Harvey P. Dale, Nov 26 2023 *)
PROG
(PARI) a(n)=local(c); c=0; for(i=1, n, c+=sumdiv(i, X, X%2)); c
(PARI) for (n=0, 1000, s=n; d=3; while (n>=d, s+=n\d; d+=2); write("b060831.txt", n, " ", s); ) \\ Harry J. Smith, Jul 12 2009
(PARI) a(n)=my(n2=n\2); sum(k=1, sqrtint(n), n\k)*2-sqrtint(n)^2-sum(k=1, sqrtint(n2), n2\k)*2+sqrtint(n2)^2 \\ Charles R Greathouse IV, Jun 18 2015
(Python)
def A060831(n): return n+sum(n//i for i in range(3, n+1, 2)) # Chai Wah Wu, Jul 16 2022
(Python)
from math import isqrt
def A060831(n): return ((t:=isqrt(m:=n>>1))+(s:=isqrt(n)))*(t-s)+(sum(n//k for k in range(1, s+1))-sum(m//k for k in range(1, t+1))<<1) # Chai Wah Wu, Oct 23 2023
CROSSREFS
Zero together with the partial sums of A001227.
KEYWORD
nonn
AUTHOR
Henry Bottomley, May 01 2001
EXTENSIONS
Definition simplified by N. J. A. Sloane, Dec 05 2020
STATUS
approved
a(n) = A001227(A252463(n)).
+20
12
1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 1, 2, 2, 4, 2, 1, 2, 2, 4, 3, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 2, 2, 2, 1, 4, 4, 2, 2, 2, 4, 2, 3, 2, 2, 3, 2, 4, 4, 2, 2, 1, 2, 2, 4, 4, 2, 2, 2, 2, 6, 4, 2, 2, 2, 4, 2, 2, 3, 2, 3, 2, 4, 2, 2, 4
OFFSET
1,5
COMMENTS
Records 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 20, 24, 32, 36, 40, ... occur at n = 1, 5, 18, 30, 90, 210, 450, 630, 1890, 3150, 5670, 6930, 20790, 34650, 62370, ...
FORMULA
a(n) = A001227(A252463(n)).
a(1) = a(2) = 1; for n > 2, a(n) = a(n/2) when n == 0 mod 4, a(n) = A051064(n) * a(n/2) when n == 2 mod 4, a(n) = a(A064989(n)), when n == 3 mod 6, otherwise a(n) = A055457(n) * a(A064989(n)).
For n > 2, let p = A252463(n). If p is even, then a(n) = a(p), if p is odd, then a(n) = A051064(p) * a(p).
PROG
(PARI)
A001227(n) = numdiv(n>>valuation(n, 2));
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A252463(n) = if(!(n%2), n/2, A064989(n));
(PARI)
A051064(n) = if(n<1, 0, 1+valuation(n, 3));
A320107(n) = if(n<=2, 1, my(p=A252463(n)); if(!(p%2), A320107(p), A051064(p)*A320107(p)));
(PARI)
A051064(n) = if(n<1, 0, 1+valuation(n, 3));
A055457(n) = if(n<1, 0, 1+valuation(n, 5));
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A320107(n) = if(n<=2, 1, if(!(n%4), A320107(n/2), if(2==(n%4), A051064(n)*A320107(n/2), if(!(n%3), A320107(A064989(n)), A055457(n)*A320107(A064989(n))))));
CROSSREFS
Cf. A001227, A005940, A051064, A055457, A252463, A320106 (Möbius transform).
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 22 2018
STATUS
approved
Number of odd divisors in A156552(n): a(1) = 0, for n > 1, a(n) = A001227(A156552(n)) = A000005(A322993(n)).
+20
8
0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 1, 2, 1, 2, 2, 4, 1, 2, 1, 2, 3, 4, 1, 2, 2, 4, 2, 4, 1, 4, 1, 2, 2, 4, 2, 4, 1, 2, 4, 4, 1, 2, 1, 2, 2, 8, 1, 2, 2, 3, 4, 2, 1, 2, 3, 2, 4, 6, 1, 2, 1, 4, 2, 6, 2, 4, 1, 4, 2, 2, 1, 4, 1, 4, 2, 4, 2, 4, 1, 2, 4, 4, 1, 6, 4, 8, 8, 8, 1, 6, 3, 4, 6, 12, 4, 4, 1, 3, 4, 4, 1, 6, 1, 2, 4
OFFSET
1,4
FORMULA
a(1) = 0; for n > 1, a(n) = A000005(A322993(n)) = A000005(A156552(2*A246277(n))) = A324105(2*A246277(n)).
PROG
(PARI) A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n))));
A246277(n) = { if(1==n, 0, while((n%2), n = A064989(n)); (n/2)); };
A322993(n) = A156552(2*A246277(n));
A324117(n) = if(1==n, 0, numdiv(A322993(n)));
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 20 2019
STATUS
approved
a(n) = A001227(A122111(n)).
+20
7
1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 4, 1, 2, 3, 2, 1, 2, 4, 2, 3, 2, 1, 4, 1, 2, 3, 2, 4, 4, 1, 2, 3, 2, 1, 4, 1, 2, 3, 2, 1, 2, 5, 6, 3, 2, 1, 4, 4, 2, 3, 2, 1, 4, 1, 2, 3, 2, 4, 4, 1, 2, 3, 6, 1, 4, 1, 2, 6, 2, 5, 4, 1, 2, 3, 2, 1, 4, 4, 2, 3, 2, 1, 4, 5, 2, 3, 2, 4, 2, 1, 8, 3, 6, 1, 4, 1, 2, 6
OFFSET
1,4
FORMULA
a(n) = A001227(A122111(n)).
PROG
(PARI)
A001227(n) = numdiv(n>>valuation(n, 2));
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A122111(n) = if(1==n, n, prime(bigomega(n))*A122111(A064989(n)));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 27 2018
STATUS
approved
Triangle, diagonal = A001227 with the rest zeros.
+20
4
1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
OFFSET
0,6
FORMULA
Infinite lower triangular matrix with A001227 (number of odd divisors of n) as the main diagonal the rest zeros.
EXAMPLE
First few rows of the triangle are:
1;
0, 1;
0, 0, 2
0, 0, 0, 1;
0, 0, 0, 0, 2;
...
CROSSREFS
Cf. A133698.
KEYWORD
nonn,tabl
AUTHOR
Gary W. Adamson, Sep 21 2007
STATUS
approved
A051731 * A001227; a(n) = Sum_{d|n} A001227(d).
+20
4
1, 2, 3, 3, 3, 6, 3, 4, 6, 6, 3, 9, 3, 6, 9, 5, 3, 12, 3, 9, 9, 6, 3, 12, 6, 6, 10, 9, 3, 18, 3, 6, 9, 6, 9, 18, 3, 6, 9, 12, 3, 18, 3, 9, 18, 6, 3, 15, 6, 12, 9, 9, 3, 20, 9, 12, 9, 6, 3, 27, 3, 6, 18, 7, 9, 18, 3, 9, 9, 18, 3, 24, 3, 6, 18, 9, 9, 18, 3, 15, 15, 6, 3, 27, 9, 6, 9, 12, 3, 36, 9, 9, 9
OFFSET
1,2
LINKS
FORMULA
Inverse Möbius transform of A001227, the number of odd divisors of n. Row sums of triangle A133699.
Dirichlet g.f. (zeta(s))^3*(1-1/2^s). - R. J. Mathar, Feb 07 2011
a(n) = Sum_{d|n} A001227(d). - Antti Karttunen, Sep 27 2018
Sum_{k=1..n} a(k) ~ n/4 * (log(n)^2 + (6*g - 2 + 2*log(2))*log(n) + 2 + 6*g^2 - log(2)^2 - 2*log(2) + 6*g*(log(2) - 1) - 6*sg1), where g is the Euler-Mascheroni constant A001620 and sg1 is the first Stieltjes constant A082633. - Vaclav Kotesovec, Feb 02 2019
G.f.: Sum_{k>=1} tau(k)*x^k/(1 - x^(2*k)), where tau = A000005. - Ilya Gutkovskiy, Sep 13 2019
Multiplicative with a(2^e) = e+1, and a(p^e) = (e+1)*(e+2)/2 for an odd prime p. - Amiram Eldar, Oct 28 2023
EXAMPLE
a(4) = sum of row 4 terms of triangle A133699: (1 + 1 + 0 + 1) = (1, 1, 0, 1) dot (1, 1, 2, 1), where A001227 = (1, 1, 2, 1, 2, 2, 2, 1, 3, ...).
MATHEMATICA
f[p_, e_] := (e+1)*(e+2)/2; f[2, e_] := e+1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 28 2023 *)
PROG
(PARI) A133700(n) = sumdiv(n, d, numdiv(d>>valuation(d, 2))); \\ Antti Karttunen, Sep 27 2018
CROSSREFS
KEYWORD
nonn,easy,mult
AUTHOR
Gary W. Adamson, Sep 21 2007
EXTENSIONS
More terms from R. J. Mathar, Jan 19 2009
Second, equivalent formula added to the definition by Antti Karttunen, Sep 27 2018
STATUS
approved
a(n) = Fibonacci(n)*A001227(n) for n>=1, where A001227(n) is the number of odd divisors of n.
+20
4
1, 1, 4, 3, 10, 16, 26, 21, 102, 110, 178, 288, 466, 754, 2440, 987, 3194, 7752, 8362, 13530, 43784, 35422, 57314, 92736, 225075, 242786, 785672, 635622, 1028458, 3328160, 2692538, 2178309, 14098312, 11405774, 36909860, 44791056, 48315634, 78176338, 252983944
OFFSET
1,3
COMMENTS
Compare g.f. to the Lambert series of A001227: Sum_{n>=1} x^(2*n-1)/(1 - x^(2*n-1)).
LINKS
FORMULA
G.f.: Sum_{n>=1} Fibonacci(2*n-1)*x^(2*n-1)/(1 - Lucas(2*n-1)*x^(2*n-1)-x^(4*n-2)).
EXAMPLE
G.f.: A(x) = x + x^2 + 4*x^3 + 3*x^4 + 10*x^5 + 16*x^6 + 26*x^7 + 21*x^8 +...
where A(x) = 1*1*x + 1*1*x^2 + 2*2*x^3 + 3*1*x^4 + 5*2*x^5 + 8*2*x^6 + 13*2*x^7 + 21*1*x^8 +...+ Fibonacci(n)*A001227(n)*x^n +...
The g.f. is also given by the identity:
A(x) = 1*x/(1-x-x^2) + 2*x^3/(1-4*x^3-x^6) + 5*x^5/(1-11*x^5-x^10) + 13*x^7/(1-29*x^7-x^14) + 34*x^9/(1-76*x^9-x^18) + 89*x^11/(1-199*x^11-x^22) +...
which involves odd-indexed Fibonacci and Lucas numbers.
MATHEMATICA
A001227[n_]:= DivisorSum[n, Mod[#, 2] &]; Table[A001227[n]*Fibonacci[n], {n, 1, 50}] (* G. C. Greubel, Jul 17 2018 *)
PROG
(PARI) {Lucas(n)=fibonacci(n-1)+fibonacci(n+1)}
{a(n)=polcoeff(sum(m=1, n, fibonacci(2*m-1)*x^(2*m-1)/(1-Lucas(2*m-1)*x^(2*m-1)-x^(4*m-2)+x*O(x^n))), n)}
for(n=1, 40, print1(a(n), ", "))
(PARI) a(n) = fibonacci(n)*sumdiv(n, d, d%2); \\ Michel Marcus, Jul 18 2018
CROSSREFS
Cf. A209445 (Pell variant).
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Feb 03 2012
STATUS
approved
E.g.f.: exp(Sum_{n>=1} A001227(n) * x^n).
+20
4
1, 1, 3, 19, 97, 801, 7411, 73123, 821409, 10977697, 151612291, 2286137811, 38308830913, 669163118209, 12649211055027, 257559356068771, 5432325991339201, 121949878889492673, 2907330680764076419, 71860237654425159187, 1871308081194213959841
OFFSET
0,3
LINKS
FORMULA
a(0) = 1 and a(n) = (n-1)! * Sum_{k=1..n} k*A001227(k)*a(n-k)/(n-k)! for n > 0.
E.g.f.: Product_{k>=1} exp(x^(2*k-1)/(1 - x^(2*k-1))). - Ilya Gutkovskiy, Nov 27 2017
Conjecture: log(a(n)/n!) ~ sqrt(n*log(n)). - Vaclav Kotesovec, Sep 07 2018
MATHEMATICA
a[n_] := a[n] = If[n == 0, 1, Sum[k*DivisorSum[k, Mod[#, 2] &]*a[n - k], {k, 1, n}]/n]; Table[n!*a[n], {n, 0, 20}] (* Vaclav Kotesovec, Sep 07 2018 *)
PROG
(PARI) N=66; x='x+O('x^N); Vec(serlaplace(exp(sum(k=1, N, sumdiv(k, d, d%2)*x^k))))
CROSSREFS
E.g.f.: exp(Sum_{n>=1} (Sum_{d|n and d is odd} d^k) * x^n): this sequence (k=0), A294394 (k=1), A294395 (k=2).
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Oct 30 2017
STATUS
approved
E.g.f.: exp(-Sum_{n>=1} A001227(n) * x^n).
+20
4
1, -1, -1, -7, 25, -41, 631, 881, 98897, -609265, 3798991, -41799671, 914146729, -15008576857, 16469525255, -5181463756351, 79515495724321, -1220435382764129, 12608713897126687, -449855614172366695, 10437031873016276921, -231918657853281955081
OFFSET
0,4
LINKS
FORMULA
a(0) = 1 and a(n) = (-1) * (n-1)! * Sum_{k=1..n} k*A001227(k)*a(n-k)/(n-k)! for n > 0.
E.g.f.: Product_{k>=1} 1 / (1 + x^k)^f(k), where f(k) = (1/k) * Sum_{j=1..k} gcd(k,j). - Ilya Gutkovskiy, Aug 17 2021
PROG
(PARI) N=66; x='x+O('x^N); Vec(serlaplace(exp(-sum(k=1, N, sumdiv(k, d, d%2)*x^k))))
CROSSREFS
E.g.f.: exp(-Sum_{n>=1} (Sum_{d|n and d is odd} d^k) * x^n): this sequence (k=0), A294460 (k=1), A294461 (k=2).
Cf. A018804.
KEYWORD
sign
AUTHOR
Seiichi Manyama, Oct 31 2017
STATUS
approved
Numerators of the sequence whose Dirichlet convolution with itself yields A001227, number of odd divisors of n.
+20
4
1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 35, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 63, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 35, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 231, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 35, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 63, 1, 1, 1, 3, 1, 1, 1, 5, 1
OFFSET
1,4
LINKS
FORMULA
a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A001227(n) - Sum_{d|n, d>1, d<n} f(d) * f(n/d)) for n > 1.
MATHEMATICA
f[1] = 1; f[n_] := f[n] = 1/2 (Sum[Mod[d, 2], {d, Divisors[n]}] - Sum[f[d] f[n/d], {d, Divisors[n][[2 ;; -2]]}]);
Table[f[n] // Numerator, {n, 1, 105}] (* Jean-François Alcover, Sep 13 2018 *)
PROG
(PARI)
up_to = 16384;
A001227(n) = numdiv(n>>valuation(n, 2)); \\ From A001227
DirSqrt(v) = {my(n=#v, u=vector(n)); u[1]=1; for(n=2, n, u[n]=(v[n]/v[1] - sumdiv(n, d, if(d>1&&d<n, u[d]*u[n/d], 0)))/2); u}; \\ From A317937.
v318453_54 = DirSqrt(vector(up_to, n, A001227(n)));
A318453(n) = numerator(v318453_54[n]);
A318454(n) = denominator(v318453_54[n]);
CROSSREFS
Cf. A001227.
Cf. A318454 (gives the denominators).
Differs from A318313 for the first time at n=81, where a(81) = 1, while A318313(81) = 3.
KEYWORD
nonn,frac
AUTHOR
STATUS
approved

Search completed in 0.315 seconds