cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Carl Najafi

Carl Najafi's wiki page.

Carl Najafi has authored 11 sequences. Here are the ten most recent ones:

A241690 Number of Sidon subsets of {1,...,n} of size 6.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 24, 80, 206, 504, 1004, 1910, 3380, 5688, 9036, 14106, 21190, 31158, 44370, 62206, 85308, 115662, 153746, 202146, 262156, 336960, 427488, 538690, 671604, 831926, 1021238, 1246604, 1510056, 1820580, 2179480
Offset: 1

Author

Carl Najafi, Apr 27 2014

Keywords

Comments

A Sidon set is a set of natural numbers A={a_1,a_2,...}, finite or infinite, such that all pairwise sums a_i+a_j (i <= j) are different.

Examples

			a(18)=8 since there are 8 subsets of {1,...,18} satisfying the required conditions, for example {1,2,5,11,13,18}.
		

Crossrefs

Column k=6 of A381476.
Cf. A054578.

Programs

  • Mathematica
    SidonQ[l__] := If[Length[Join[Plus @@@ Subsets[l, {2}], 2 l]] == Length[Union[Join[Plus @@@ Subsets[l, {2}], 2 l]]], True, False]
    Table[Length@Select[Subsets[Range[n], {6}], SidonQ[#] &], {n, 1, 30}]

A241689 Number of Sidon subsets of {1,...,n} of size 5.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 22, 68, 156, 320, 584, 1008, 1622, 2520, 3734, 5428, 7612, 10488, 14126, 18744, 24390, 31436, 39914, 50212, 62390, 76932, 93918, 113960, 137058, 163896, 194632, 229988, 270018, 315712, 367106, 425220, 490164, 563080, 644096
Offset: 1

Author

Carl Najafi, Apr 27 2014

Keywords

Comments

A Sidon set is a set of natural numbers A={a_1,a_2,...}, finite or infinite, such that all pairwise sums a_i+a_j (i <= j) are different.

Examples

			a(12)=4 since the only subsets of {1,...,12} satisfying the required conditions are {1,2,5,10,12}, {1,3,8,9,12}, {1,3,8,11,12}, and {1,4,5,10,12}.
		

Crossrefs

Column k=5 of A381476.
Cf. A054578.

Programs

  • Mathematica
    SidonQ[l__] := If[Length[Join[Plus @@@ Subsets[l, {2}], 2 l]] == Length[Union[Join[Plus @@@ Subsets[l, {2}], 2 l]]], True, False]
    Table[Length@Select[Subsets[Range[n], {5}], SidonQ[#] &], {n, 1, 30}]

A241688 Number of Sidon subsets of {1,...,n} of size 4.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 10, 26, 60, 110, 190, 304, 466, 676, 958, 1312, 1762, 2310, 2984, 3786, 4750, 5874, 7196, 8720, 10484, 12488, 14780, 17360, 20276, 23530, 27174, 31210, 35696, 40630, 46074, 52032, 58566, 65676, 73434, 81840, 90966, 100814, 111460, 122906
Offset: 1

Author

Carl Najafi, Apr 27 2014

Keywords

Comments

A Sidon set is a set of natural numbers A={a_1,a_2,...}, finite or infinite, such that all pairwise sums a_i+a_j (i <= j) are different.

Examples

			a(7)=2 since the only subsets of {1,...,7} satisfying the required conditions are {1,2,5,7} and {1,3,6,7}.
		

Crossrefs

Column k=4 of A381476.
Cf. A054578.

Programs

  • Mathematica
    SidonQ[l__] := If[Length[Join[Plus @@@ Subsets[l, {2}], 2 l]] == Length[Union[Join[Plus @@@ Subsets[l, {2}], 2 l]]], True, False]
    Table[Length@Select[Subsets[Range[n], {4}], SidonQ[#] &], {n, 1, 30}]

Formula

It appears to be the case that G.f.: 2*x^7*(1+3*x+3*x^2+5*x^3)/((1-x)^5*(1+x)^2*(1+x^2)*(1+x+x^2)), corrected by Vaclav Kotesovec, May 03 2014
a(n) ~ 1/24*n^4 (deduced from g.f.). - Ralf Stephan, Apr 29 2014
a(n) = a(n-11)+a(n-8)-a(n-3)+2*(a(n-6)+a(n-1)-a(n-10)-a(n-5)). - Fung Lam, May 02 2014
Explicit formula (derived from g.f.): a(n) = n^4/24 - 7*n^3/12 + 29*n^2/12 - 15*n/8 - floor(n/4) - 4/3*floor(n/3) + (n/2-9/4)*floor(n/2) - floor((n+1)/4) - 2/3*floor((n+1)/3). - Vaclav Kotesovec, May 03 2014

A174651 Numbers n such that Sum_{k=1..n} k*Mobius(k) = n.

Original entry on oeis.org

1, 88, 125, 5246
Offset: 1

Author

Carl Najafi, Dec 22 2012

Keywords

Comments

No more terms < 10^7.

Crossrefs

Programs

  • Mathematica
    muSums = Accumulate@Table[MoebiusMu[k] k, {k, 10^7}]; A174651 = {}; For[i = 1, i <= Length@muSums, i++, If[muSums[[i]] == i, AppendTo[A174651, i]]]; A174651
    smQ[x_]:=x==Total[Table[n*MoebiusMu[n],{n,x}]]; Select[Range[6000],smQ] (* Harvey P. Dale, Oct 05 2019 *)

A220400 Number of ways to write n as sum of at least 2 consecutive odd positive integers.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 1, 0, 0, 0, 2, 1, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 1, 2, 0, 0, 3, 1, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 2, 0, 0, 2, 3, 1, 0, 0, 1, 1, 0, 0, 3, 0, 0, 2, 1, 1, 0, 0, 3, 2, 0, 0, 2, 1, 0, 1, 2, 0, 0, 1, 1, 1, 0, 1, 4, 0, 0, 2, 2, 0, 0, 0, 2, 3
Offset: 0

Author

Carl Najafi, Dec 13 2012

Keywords

Comments

Records occur at 0, 4, 16, 48, 96, 144, 240, 480, 720, 960, 1440, ..., (A297160). - Antti Karttunen, Dec 27 2017
Also number of ways to express n in the form k + (k + 2) + ... + (k + 2*m - 2) = m * (k + m - 1) where k > 0 is odd and m > 0 and m * (m + 1) < n. - David A. Corneth, Dec 27 2017

Examples

			For n=16 we can write 1+3+5+7 and 7+9, thus a(16) = 2.
For n = 24, we look for sums of consecutive numbers of m terms of the form m * (k + m - 1) for odd k and m * (m + 1) < 24, i.e., m < 5. We can factorize 24 as such in two positive factors as 1 * 24 = 2 * 12 = 3 * 8 = 4 * 6 giving m = 1, 2, 3 and 4 respectively. Solving for k gives k = 24, k = 11, k = 6 and k = 3 respectively. Of these values, two are odd so a(24) = 2. Superfluously, the corresponding sums are 11 + 13 = 3 + 5 + 7 + 9. - _David A. Corneth_, Dec 28 2017
		

Crossrefs

Cf. A069283 (even numbers lead to this sequence).
Cf. A297160 (positions of records).

Programs

  • Mathematica
    nn = 100; t = Table[0, {nn}]; Do[s = odd = 2*n - 1; While[odd = odd + 2; s = s + odd; s <= nn, t[[s]]++], {n, nn/2}]; Join[{0}, t] (* T. D. Noe, Dec 18 2012 *)
  • PARI
    a(n) = if(n==0, return(0)); my(d = divisors(n)); (#d + 1) \ 2 - sum(i = 2, (#d + 1) \ 2, (n / d[i] - d[i]) % 2) - 1 \\ David A. Corneth, Dec 27 2017
  • Scheme
    (define (A220400 n) (let loop ((s 0) (begin 1) (end 1) (sum 1)) (cond ((> begin (/ n 2)) s) ((< sum n) (loop s begin (+ end 2) (+ sum end 2))) ((> sum n) (loop s (+ begin 2) end (- sum begin))) (else (loop (+ 1 s) (+ begin 2) end (- sum begin)))))) ;; Antti Karttunen, Dec 27 2017
    

Extensions

More terms from Antti Karttunen, Dec 27 2017

A220377 Number of partitions of n into three distinct and mutually relatively prime parts.

Original entry on oeis.org

1, 0, 2, 1, 3, 1, 6, 1, 7, 3, 7, 3, 14, 3, 15, 6, 14, 6, 25, 6, 22, 10, 25, 9, 42, 8, 34, 15, 37, 15, 53, 13, 48, 22, 53, 17, 78, 17, 65, 30, 63, 24, 99, 24, 88, 35, 84, 30, 126, 34, 103, 45, 103, 38, 166, 35, 124, 57, 128, 51, 184, 44, 150, 67, 172, 52, 218
Offset: 6

Author

Carl Najafi, Dec 13 2012

Keywords

Comments

The Heinz numbers of these partitions are the intersection of A005117 (strict), A014612 (triples), and A302696 (coprime). - Gus Wiseman, Oct 14 2020

Examples

			For n=10 we have three such partitions: 1+2+7, 1+4+5 and 2+3+5.
From _Gus Wiseman_, Oct 14 2020: (Start)
The a(6) = 1 through a(20) = 15 triples (empty column indicated by dot, A..H = 10..17):
321  .  431  531  532  731  543  751  743  753  754  971  765  B53  875
        521       541       651       752  951  853  B51  873  B71  974
                  721       732       761  B31  871  D31  954  D51  A73
                            741       851       952       972       A91
                            831       941       B32       981       B54
                            921       A31       B41       A71       B72
                                      B21       D21       B43       B81
                                                          B52       C71
                                                          B61       D43
                                                          C51       D52
                                                          D32       D61
                                                          D41       E51
                                                          E31       F41
                                                          F21       G31
                                                                    H21
(End)
		

Crossrefs

A023022 is the 2-part version.
A101271 is the relative prime instead of pairwise coprime version.
A220377*6 is the ordered version.
A305713 counts these partitions of any length, with Heinz numbers A302797.
A307719 is the non-strict version.
A337461 is the non-strict ordered version.
A337563 is the case with no 1's.
A337605 is the pairwise non-coprime instead of pairwise coprime version.
A001399(n-6) counts strict 3-part partitions, with Heinz numbers A007304.
A008284 counts partitions by sum and length, with strict case A008289.
A318717 counts pairwise non-coprime strict partitions.
A326675 ranks pairwise coprime sets.
A327516 counts pairwise coprime partitions.
A337601 counts 3-part partitions whose distinct parts are pairwise coprime.

Programs

  • Mathematica
    Table[Length@Select[ IntegerPartitions[ n, {3}], #[[1]] != #[[2]] != #[[3]] && GCD[#[[1]], #[[2]]] == 1 && GCD[#[[1]], #[[3]]] == 1 && GCD[#[[2]], #[[3]]] == 1 &], {n, 6, 100}]
    Table[Count[IntegerPartitions[n,{3}],?(CoprimeQ@@#&&Length[ Union[#]] == 3&)],{n,6,100}] (* _Harvey P. Dale, May 22 2020 *)
  • PARI
    a(n)=my(P=partitions(n));sum(i=1,#P,#P[i]==3&&P[i][1]Charles R Greathouse IV, Dec 14 2012

Formula

a(n > 2) = A307719(n) - 1. - Gus Wiseman, Oct 15 2020

A220169 Numbers n for which phi(n^2) = phi(n-1) * phi(n+1).

Original entry on oeis.org

2, 4, 16, 256, 976, 3256, 5188, 11716, 13366, 22936, 65536, 307396, 491536, 589408, 983776, 1659586, 2822716, 3137356, 5577826, 6475456, 7378372, 8698096, 10798726, 32235736, 37797436, 39220126, 39285436, 51555136, 52077196, 56992552, 63767926, 70075996, 82391002
Offset: 1

Author

Carl Najafi, Dec 06 2012

Keywords

Examples

			phi(976^2) = 468480 = 480*976 = phi(975)*phi(977).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], EulerPhi[#^2] == EulerPhi[# - 1] EulerPhi[# + 1] &]
  • PARI
    isok(n) = eulerphi(n^2) == eulerphi(n-1) * eulerphi(n+1); \\ Michel Marcus, Aug 12 2019

Extensions

More terms from Amiram Eldar, Aug 12 2019

A220160 Numbers n for which phi(n) = phi(n-1) - phi(n+1).

Original entry on oeis.org

194, 3530, 9338, 27230, 46794, 78182, 90194, 112994, 135014, 437184, 849404, 935220, 1078580, 1283600, 1986974, 2209584, 2341184, 2411174, 2689694, 2744144, 3619070, 3712544, 4738184, 5132984, 6596120, 7829030, 8184714, 12176108, 12292004, 13342958, 26400842
Offset: 1

Author

Carl Najafi, Dec 06 2012

Keywords

Examples

			phi(3529) - phi(3531) = 3528 - 2120 = 1408 = phi(3530).
		

Crossrefs

Programs

A201740 The value of the Mertens function at n^n.

Original entry on oeis.org

1, -1, -1, -1, 4, 39, -158, 211, -186, -33722, 55130, 192039, -4032991
Offset: 1

Author

Carl Najafi, Dec 04 2011

Keywords

References

  • Marc Deleglise and Joel Rivat, Computing the summation of the Mobius function, Experiment. Math. 5 (1996), no. 4, 291-295.

Crossrefs

Programs

  • Mathematica
    Table[Sum[MoebiusMu[k], {k, n^n}], {n, 7}]

Formula

a(n) = A002321(n^n).

Extensions

a(9)-a(10) from Max Alekseyev, Dec 10 2011
a(11) from Donovan Johnson, Jun 21 2012
a(12)-a(13) from Rikard Nordgren, Nov 10 2012

A195349 Numbers n such that Sum_{k=1..n} d(k) divides Product_{k=1..n} d(k), where d(k) is the number of divisors of k.

Original entry on oeis.org

1, 7, 19, 41, 57, 64, 68, 133, 145, 149, 164, 235, 267, 291, 317, 336, 358, 419, 433, 503, 528, 566, 599, 612, 659, 726, 801, 927, 1017, 1035, 1077, 1118, 1190, 1206, 1213, 1281, 1297, 1309, 1320, 1323, 1367, 1446, 1473, 1485, 1516, 1595, 1611, 1634, 1941
Offset: 1

Author

Carl Najafi, Sep 16 2011

Keywords

Comments

d(k) is sometimes called tau(k) or sigma_0(k). Is this sequence infinite?

Crossrefs

Programs

  • Mathematica
    t = {}; a = 0; b = 1; Do[a = a + DivisorSigma[0, n]; b = b*DivisorSigma[0, n]; If[Mod[b, a] == 0, AppendTo[t, n]], {n, 2000}]; t (* T. D. Noe, Sep 16 2011 *)
    With[{c=DivisorSigma[0,Range[2000]]},Position[Thread[{FoldList[ Times,c], Accumulate[ c]}],?(Divisible[#[[1]],#[[2]]]&),1,Heads->False]] // Flatten (* _Harvey P. Dale, Apr 14 2019 *)
  • Python
    from sympy import divisor_count
    A195349_list, s, p = [], 0, 1
    for k in range(1,10**4):
        d = divisor_count(k)
        s += d
        p *= d
        if p % s == 0:
            A195349_list.append(k) # Chai Wah Wu, Oct 09 2021