A239313
Triangle read by rows: T(n,k), n>=1, k>=1, in which column k lists the odd numbers interleaved with k-1 zeros, except the first column which lists 0 together with the nonnegative integers, and the first element of column k is in row k*(k+1)/2.
Original entry on oeis.org
0, 0, 1, 1, 2, 0, 3, 3, 4, 0, 1, 5, 5, 0, 6, 0, 0, 7, 7, 3, 8, 0, 0, 1, 9, 9, 0, 0, 10, 0, 5, 0, 11, 11, 0, 0, 12, 0, 0, 3, 13, 13, 7, 0, 1, 14, 0, 0, 0, 0, 15, 15, 0, 0, 0, 16, 0, 9, 5, 0, 17, 17, 0, 0, 0, 18, 0, 0, 0, 3, 19, 19, 11, 0, 0, 1, 20, 0, 0, 7, 0, 0
Offset: 1
Triangle begins (row n = 1..24):
0;
0;
1, 1;
2, 0;
3, 3;
4, 0, 1;
5, 5, 0;
6, 0, 0;
7, 7, 3;
8, 0, 0, 1;
9, 9, 0, 0;
10, 0, 5, 0;
11, 11, 0, 0;
12, 0, 0, 3;
13, 13, 7, 0, 1;
14, 0, 0, 0, 0;
15, 15, 0, 0, 0;
16, 0, 9, 5, 0;
17, 17, 0, 0, 0;
18, 0, 0, 0, 3;
19, 19, 11, 0, 0, 1;
20, 0, 0, 7, 0, 0;
21, 21, 0, 0, 0, 0;
22, 0, 13, 0, 0, 0;
...
For n = 15 the divisors of 15 are 1, 3, 5, 15 therefore the sum of divisors of 15 except 1 and 15 is 3 + 5 = 8. On the other hand the 15th row of triangle is 13, 13, 7, 0, 1, hence the alternating row sum is 13 - 13 + 7 - 0 + 1 = 8, equalling the sum of divisors of 15 except 1 and 15.
If n is even then the alternating sum of the n-th row of triangle is simpler than the sum of divisors of n, except 1 and n. Example: the sum of divisors of 24 except 1 and 24 is 2 + 3 + 4 + 6 + 8 + 12 = 35, and the alternating sum of the 24th row of triangle is 22 - 0 + 13 - 0 + 0 - 0 = 35.
Cf.
A000203,
A000217,
A001065,
A001227,
A001477,
A193356,
A196020,
A211343,
A212119,
A228813,
A231345,
A231347,
A235791,
A235794,
A236104,
A236106,
A236112.
A255655
The sum of the odd terms in row n of A050873.
Original entry on oeis.org
1, 1, 5, 2, 9, 5, 13, 4, 21, 9, 21, 10, 25, 13, 45, 8, 33, 21, 37, 18, 65, 21, 45, 20, 65, 25, 81, 26, 57, 45, 61, 16, 105, 33, 117, 42, 73, 37, 125, 36, 81, 65, 85, 42, 189, 45, 93, 40, 133, 65, 165, 50, 105, 81, 189, 52, 185, 57, 117, 90
Offset: 1
a(10)=9 because row 10 of A050873 is gcd(10,k) for k=1,2,...10: 1, 2, 1, 2, 5, 2, 1, 2, 1, 10. If we sum the odd terms in this row we have 1+1+5+1+1=9.
-
nn = 60; f[list_, i_] := list[[i]]; a =Table[EulerPhi[n], {n, 1, nn}]; b =
Table[If[OddQ[n], n, 0], {n, 1, nn}]; Table[DirichletConvolve[f[a, n], f[b, n], n, m], {m, 1, nn}]
Table[Sum[(d*(1-(-1)^d)/2)*EulerPhi[n/d], {d, Divisors[n]}], {n, 1, 50}] (* Vaclav Kotesovec, Feb 02 2019 *)
f[p_, e_] := p^(e-1) * If[p == 2, 1, (p-1)*e + p]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Apr 30 2023 *)
-
a(n) = sum(k=1, n, my(g = gcd(n, k)); if (g % 2, g, 0)); \\ Michel Marcus, Feb 05 2018
Original entry on oeis.org
0, 2, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0, 17, 0, 19, 0, 21, 0, 23, 0, 25, 0, 27, 0, 29, 0, 31, 0, 33, 0, 35, 0, 37, 0, 39, 0, 41, 0, 43, 0, 45, 0, 47, 0, 49, 0, 51, 0, 53, 0, 55
Offset: 1
-
Accumulate@ Nest[Append[#, Block[{k = 1, s = 1}, While[Nand[FreeQ[#, s k], IntegerQ@ Mean[Append[#, s k]]], If[s == 1, s = -1, k++; s = 1]]; s k]] &, {0}, 54] (* Michael De Vlieger, Dec 12 2017 *)
LinearRecurrence[{0,2,0,-1},{0,2,3,0,5,0},60] (* or *) Join[{0,2},Riffle[ 2*Range[ 30]+1,0]] (* Harvey P. Dale, Oct 21 2021 *)
A309324
Expansion of Sum_{k>=1} psi(k) * x^k/(1 + x^k), where psi = Dedekind psi function (A001615).
Original entry on oeis.org
1, 2, 5, 2, 7, 10, 9, 2, 17, 14, 13, 10, 15, 18, 35, 2, 19, 34, 21, 14, 45, 26, 25, 10, 37, 30, 53, 18, 31, 70, 33, 2, 65, 38, 63, 34, 39, 42, 75, 14, 43, 90, 45, 26, 119, 50, 49, 10, 65, 74, 95, 30, 55, 106, 91, 18, 105, 62, 61, 70, 63, 66, 153, 2, 105, 130, 69, 38, 125, 126, 73
Offset: 1
-
nmax = 71; CoefficientList[Series[Sum[DirichletConvolve[j, MoebiusMu[j]^2, j, k] x^k/(1 + x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
Table[Sum[MoebiusMu[n/d]^2 Plus @@ Select[Divisors@ d, OddQ], {d, Divisors[n]}], {n, 1, 71}]
f[2, e_] := 2; f[p_, e_] := (p^e*(p+1)-2)/(p-1); a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Dec 01 2020 *)
-
a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,1] == 2, 2, (f[i,1]^f[i,2]*(f[i,1]+1)-2)/(f[i,1]-1)));} \\ Amiram Eldar, Nov 06 2022
A309338
a(n) = n^4 if n odd, 7*n^4/8 if n even.
Original entry on oeis.org
0, 1, 14, 81, 224, 625, 1134, 2401, 3584, 6561, 8750, 14641, 18144, 28561, 33614, 50625, 57344, 83521, 91854, 130321, 140000, 194481, 204974, 279841, 290304, 390625, 399854, 531441, 537824, 707281, 708750, 923521, 917504, 1185921, 1169294, 1500625, 1469664, 1874161, 1824494
Offset: 0
- Amiram Eldar, Table of n, a(n) for n = 0..10000
- Index entries for linear recurrences with constant coefficients, signature (0,5,0,-10,0,10,0,-5,0,1).
-
a[n_] := If[OddQ[n], n^4, 7 n^4/8]; Table[a[n], {n, 0, 38}]
nmax = 38; CoefficientList[Series[x (1 + 14 x + 76 x^2 + 154 x^3 + 230 x^4 + 154 x^5 + 76 x^6 + 14 x^7 + x^8)/(1 - x^2)^5, {x, 0, nmax}], x]
LinearRecurrence[{0, 5, 0, -10, 0, 10, 0, -5, 0, 1}, {0, 1, 14, 81, 224, 625, 1134, 2401, 3584, 6561}, 39]
Table[n^4 (15 - (-1)^n)/16, {n, 0, 38}]
A327123
Expansion of Sum_{k>=1} phi(k) * x^k / (1 + x^(2*k)), where phi = A000010.
Original entry on oeis.org
1, 1, 1, 2, 5, 1, 5, 4, 5, 5, 9, 2, 13, 5, 5, 8, 17, 5, 17, 10, 5, 9, 21, 4, 25, 13, 13, 10, 29, 5, 29, 16, 9, 17, 25, 10, 37, 17, 13, 20, 41, 5, 41, 18, 25, 21, 45, 8, 37, 25, 17, 26, 53, 13, 45, 20, 17, 29, 57, 10, 61, 29, 25, 32, 65, 9, 65, 34, 21
Offset: 1
-
nmax = 69; CoefficientList[Series[Sum[EulerPhi[k] x^k/(1 + x^(2 k)), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
A050469[n_] := DivisorSum[n, # &, MemberQ[{1}, Mod[n/#, 4]] &] - DivisorSum[n, # &, MemberQ[{3}, Mod[n/#, 4]] &]; a[n_] := DivisorSum[n, MoebiusMu[n/#] A050469[#] &]; Table[a[n], {n, 1, 69}]
f[p_, e_] := If[Mod[p, 4] == 1, p^e, (p^(e+1) - p^e + 2*(-1)^e)/(p+1)]; f[2, e_] := 2^(e-1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 70] (* Amiram Eldar, Aug 28 2023 *)
-
a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; e = f[i,2]; if(p == 2, 2^(e-1), if(p%4 == 1, p^e, (p^(e+1) - p^e + 2*(-1)^e)/(p+1)))); } \\ Amiram Eldar, Aug 28 2023
A328373
Expansion of Sum_{k>=1} x^(k^2) * (1 + x^(2*k^2)) / (1 - x^(2*k^2))^2.
Original entry on oeis.org
1, 0, 3, 1, 5, 0, 7, 0, 10, 0, 11, 3, 13, 0, 15, 1, 17, 0, 19, 5, 21, 0, 23, 0, 26, 0, 30, 7, 29, 0, 31, 0, 33, 0, 35, 10, 37, 0, 39, 0, 41, 0, 43, 11, 50, 0, 47, 3, 50, 0, 51, 13, 53, 0, 55, 0, 57, 0, 59, 15, 61, 0, 70, 1, 65, 0, 67, 17, 69, 0, 71, 0, 73, 0, 78, 19, 77, 0, 79, 5, 91
Offset: 1
-
a:=[];for n in [1..81] do v:=[d:d in Divisors(n)| IsOdd(d) and IsSquare(n div d)]; if #v ne 0 then Append(~a,&+v); else Append(~a,0); end if; end for; a; // Marius A. Burtea, Oct 14 2019
-
nmax = 81; CoefficientList[Series[Sum[x^(k^2) (1 + x^(2 k^2))/(1 - x^(2 k^2))^2, {k, 1, Floor[Sqrt[nmax]] + 1}], {x, 0, nmax}], x] // Rest
Table[DivisorSum[n, # &, OddQ[#] && IntegerQ[(n/#)^(1/2)] &], {n, 1, 81}]
f[p_, e_] := If[p == 2, Boole @ EvenQ[e], If[EvenQ[e], (p^(e + 2) - 1)/(p^2 - 1), (p^(e + 2) - p)/(p^2 - 1)]]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Oct 16 2020 *)
-
a(n) = sumdiv(n, d, if ((d%2) && issquare(n/d), d)); \\ Michel Marcus, Oct 14 2019
A289870
a(n) = n*(n + 1) for n odd, otherwise a(n) = (n - 1)*(n + 1).
Original entry on oeis.org
-1, 2, 3, 12, 15, 30, 35, 56, 63, 90, 99, 132, 143, 182, 195, 240, 255, 306, 323, 380, 399, 462, 483, 552, 575, 650, 675, 756, 783, 870, 899, 992, 1023, 1122, 1155, 1260, 1295, 1406, 1443, 1560, 1599, 1722, 1763, 1892, 1935, 2070, 2115, 2256, 2303, 2450, 2499
Offset: 0
-
a[n_] := (n + 1)(n - 1 + Mod[n, 2]); Table[a[n], {n, 0, 50}]
-
a(n)=if(n%2, n, n-1)*(n+1) \\ Charles R Greathouse IV, Jul 14 2017
A383641
a(n) is the difference between the sum of even composites and the sum of the odd composites in the first n positive integers.
Original entry on oeis.org
0, 0, 0, 4, 4, 10, 10, 18, 9, 19, 19, 31, 31, 45, 30, 46, 46, 64, 64, 84, 63, 85, 85, 109, 84, 110, 83, 111, 111, 141, 141, 173, 140, 174, 139, 175, 175, 213, 174, 214, 214, 256, 256, 300, 255, 301, 301, 349, 300, 350, 299, 351, 351, 405, 350, 406, 349, 407, 407
Offset: 1
Of the first 9 positive integers, 4, 6, and 8 are even composites and 9 is an odd composite, so a(9) = 4 + 6 + 8 - 9 = 9.
Cf.
A000720,
A002808,
A004526,
A010701,
A028552,
A034387,
A066247,
A071904,
A101256,
A193356,
A262044,
A383259.
-
A383641:=n->`if`(n=1,0,floor((n-2)/2)-n*(n mod 2)+add(ithprime(i),i=2..NumberTheory:-pi(n)));seq(A383641(n),n=1..59);
-
lim=59;cn=Select[Range[lim],CompositeQ];a[n_]:=Total[Select[cn,EvenQ[#]&<=n&]]-Total[Select[cn,OddQ[#]&<=n&]];Array[a,lim] (* James C. McMahon, May 14 2025 *)
A267942
Interleave (n-1)^2 + 2 and (n+1)^2 + 2.
Original entry on oeis.org
3, 3, 2, 6, 3, 11, 6, 18, 11, 27, 18, 38, 27, 51, 38, 66, 51, 83, 66, 102, 83, 123, 102, 146, 123, 171, 146, 198, 171, 227, 198, 258, 227, 291, 258, 326, 291, 363, 326, 402, 363, 443, 402, 486, 443, 531, 486, 578, 531, 627, 578, 678, 627, 731, 678, 786, 731
Offset: 0
a(0) = (2+13)/5, a(1) = (13+2)/5, a(2) = (5+5)/5, a(3) = (29+1)/5, ... (using first formula).
Cf.
A000290,
A007395,
A010701,
A022998,
A056105,
A056109,
A059100,
A161680,
A174474,
A193356,
A255844,
A261327.
-
&cat [[(n-1)^2+2, (n+1)^2+2]: n in [0..50]]; // Vincenzo Librandi, Jan 23 2016
-
Flatten[Table[{n^2 - 2 n + 3, n^2 + 2 n + 3}, {n, 0, 30}]] (* Vincenzo Librandi, Jan 23 2016 *)
CoefficientList[Series[(3 - 7 x^2 + 4 x^3 + 2 x^4)/((1 - x)^3 (1 + x)^2), {x, 0, 56}], x] (* Michael De Vlieger, Jan 24 2016 *)
-
Vec((3-7*x^2+4*x^3+2*x^4)/((1-x)^3*(1+x)^2) + O(x^100)) \\ Colin Barker, Jan 22 2016
Comments