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.

Showing 1-6 of 6 results.

A096436 a(n) = the number of squared primes and 1's needed to sum to n.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 2, 1, 2, 3, 3, 2, 3, 4, 4, 3, 2, 3, 4, 4, 3, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 4, 3, 4, 5, 5, 4, 3, 4, 5, 5, 4, 5, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 4, 3, 4, 5, 5, 4, 3, 4, 5, 5, 4, 5, 6, 2, 3, 4, 5, 3, 4, 5, 6, 4, 3, 4, 5, 5, 4, 5, 6, 6, 5, 4, 5, 6, 6, 5, 6, 2, 3, 4, 5, 3, 4, 5, 6
Offset: 1

Views

Author

Tom Raes (tommy1729(AT)hotmail.com), Aug 10 2004

Keywords

Comments

a(n) has a new maximum at n=1,2,3,7,24,73,266,795.
I suspect that a(n) <= 9 for all n. - Robert G. Wilson v, Sep 18 2004

Examples

			a(5) = 2 because 5=4+1.
a(17) = 3 because 17=9+4+4.
A number may have many such sums: 27=25+1+1=9+9+9, 50=25+25=49+1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{d = n, k = PrimePi[ Sqrt[n]], sp = {}}, While[d > 3, While[p = Prime[k]; d >= p^2, AppendTo[sp, p]; d = d - p^2]; k-- ]; While[d != 0, AppendTo[sp, 1]; d = d - 1]; If[Position[sp, 3] != {} && sp[[ -3]] == 1, sp = Delete[Drop[sp, -3], Position[sp, 3][[1]]]; AppendTo[sp, {2, 2, 2}]]; Reverse[ Sort[ Flatten[ sp]]]]; Table[ Length[ f[n]], {n, 105}] (* Robert G. Wilson v, Sep 20 2004 *)

Extensions

Edited and extended by Robert G. Wilson v, Sep 18 2004
Edited by Don Reble, Apr 23 2006

A063275 Numbers that require three powerful numbers (definition 1) to sum to them.

Original entry on oeis.org

3, 6, 11, 14, 19, 21, 22, 30, 38, 39, 42, 46, 47, 51, 55, 56, 60, 62, 66, 67, 69, 70, 71, 75, 77, 78, 79, 83, 84, 86, 92, 93, 94, 95, 102, 103, 105, 107, 110, 114, 115, 118, 120, 123, 131, 138, 139, 142, 143, 147, 151, 154, 156, 158, 159, 163, 165, 166, 167, 168, 175
Offset: 1

Views

Author

Jud McCranie, Jul 13 2001

Keywords

Examples

			The powerful numbers (A001694) start 1, 4, 8, 9, ... Now 11 = 1+1+9 and is not the sum of fewer terms, so 11 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    With[{m = 200}, pow = Select[Range[m], # == 1 || Min[FactorInteger[#][[;; , 2]]] > 1 &]; s2 = Select[Union[Plus @@@ Tuples[pow, {2}]], # <= m &]; s3 = Select[Union[Plus @@@ Tuples[pow, {3}]], # <= m &]]; Complement[s3, pow, s2] (* Amiram Eldar, Feb 12 2023 *)

Extensions

Offset corrected by Amiram Eldar, Feb 12 2023

A274459 Least number of perfect powers that add up to n.

Original entry on oeis.org

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

Views

Author

Sergio Pimentel, Jun 23 2016

Keywords

Comments

Least number of perfect powers (A001597) needed to add up to n.
This sequence is close to but not exactly equal to A063274.
a(n) is at most 4 since any number can be written as a sum of 4 squares (Lagrange's theorem), but it is possible that for a sufficiently large n, a(n) < 4.
a(n) <= a(i) + a(n-i) for 1 <= i <= n-1. (for computational ease, the maximum value for i can be chosen as floor(n/2)). a(1991) = 4. for 1992 <= k <= 20000, there is no k such that a(k) = 4. - David A. Corneth, Jun 24 2016 [Next such k is 25887, see A113505. - Vaclav Kotesovec, Jun 25 2016]

Examples

			a(31) = 2 since 31 can be written as the sum of two (31 = 3^3 + 2^2 = 27 + 4) but no fewer than two perfect powers.
		

Crossrefs

Cf. A063275 (indices for which a(n)=3), A113505 (indices for which a(n)=4).

Programs

  • Mathematica
    nn = 72; t = Select[Range@ nn, # == 1 || GCD @@ FactorInteger[#][[All, 2]] > 1 &]; Table[Min@ Map[Length, Select[IntegerPartitions@ n, AllTrue[#, MemberQ[t, #] &] &]], {n, nn}] (* Michael De Vlieger, Jun 23 2016, after Ant King at A001597 *)
  • PARI
    lista(n) = {my(v = vector(n)); for(i = 2,sqrtint(n), for(j = 2, logint(n, i), v[i^j] = 1)); v[1]=1; v[2]=2; for(i=3, #v, if(v[i]==0, v[i] = vecmin(vector( i\2, k,v[k] + v[i-k]))));v} \\ David A. Corneth, Jun 24 2016; corrected by Peter Schorn, Jun 09 2022

Extensions

More terms from Michael De Vlieger, Jun 23 2016
Terms from a(74) from David A. Corneth, Jun 24 2016

A115354 a(n) is the smallest number representable in exactly n ways as a sum of 2 powerful(1) numbers.

Original entry on oeis.org

2, 17, 108, 153, 297, 657, 1764, 2052, 4644, 6156, 10800, 16200, 22932, 29000, 11025, 54225, 92025, 68796, 100548, 99225, 44100, 88200, 264600, 431244, 176400, 441000, 666468, 1151172, 352800, 617400, 396900, 926100, 980100, 793800, 1234800
Offset: 1

Views

Author

Giovanni Resta, Jan 21 2006

Keywords

Comments

Here we are considering powerful numbers (first definition) A001694. Note that, by definition, 1 is powerful.

Examples

			a(2)=17, since 17 = 16+1 = 8+9.
		

Crossrefs

Programs

  • Mathematica
    pwfQ[n_] := n == 1 || Min[Transpose[FactorInteger@n][[2]]] > 1; lim=200000; pt = Select[Range[lim], pwfQ]; t = Table[0, {i, lim}]; Do[v = pt[[i]]+ pt[[j]]; If[v<=lim, t[[v]]++ ], {i, Length@pt}, {j, i}]; Table[Position[t, k][[1, 1]], {k, 22}]

Extensions

a(23)-a(35) from Donovan Johnson, Dec 07 2008

A115355 a(n) is the smallest number representable in exactly n ways as a sum of 3 powerful(1) numbers.

Original entry on oeis.org

3, 17, 33, 41, 66, 77, 89, 117, 133, 145, 153, 189, 161, 225, 301, 257, 324, 333, 341, 297, 432, 425, 369, 517, 613, 441, 521, 585, 513, 809, 689, 792, 657, 1001, 801, 881, 1000, 1017, 873, 945, 900, 1265, 1169, 1425, 1089, 1125, 1197, 1481, 1161, 1584
Offset: 1

Views

Author

Giovanni Resta, Jan 21 2006

Keywords

Comments

Here we are considering powerful numbers (first definition) A001694. Note that, by definition, 1 is powerful.

Examples

			a(2) = 17 since 17 = 4+4+9 = 8+8+1.
		

Crossrefs

Programs

  • Mathematica
    pwfQ[n_] := n==1 || Min[Transpose[FactorInteger@n][[2]]] > 1; lim = 5000; pt = Select[Range[lim], pwfQ]; t = Table[0, {i, lim}]; Do[v = pt[[i]]+pt[[j]]+pt[[k]]; If[v <= lim, t[[v]]++ ], {i, Length@pt}, {j, i}, {k, j}]; Table[Position[t, k][[1, 1]], {k, 60}]

A354761 Least number of squares and cubes that add up to n.

Original entry on oeis.org

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

Views

Author

Peter Schorn, Jun 06 2022

Keywords

Comments

a(n) <= 4 since any number can be written as a sum of 4 squares (Lagrange's theorem).
Sequence first differs from A063274, A225926 and A274459 at n = 32 since 32 is a powerful number, a prime power and a perfect power but neither a square nor a cube.

Examples

			a(1) = 1, a(4) = 1 (4 = 2^2), a(7) = 4 (7 = 2^2 + 1^2 + 1^2 + 1^2), a(8) = 1 (8 = 2^3), a(12) = 2 (12 = 2^3 + 2^2), a(17) = 2 (17 = 4^2 + 1^2), a(32) = 2 (32 = 4^2 + 4^2).
		

Crossrefs

Programs

  • PARI
    lista(n) = {my(v = vector(n)); for(j = 2, 3, for(i = 2, sqrtnint(n, j), v[i^j] = 1)); v[1]=1; v[2]=2; for(i=3, #v, if(v[i]==0, v[i] = vecmin(vector(i\2, k, v[k] + v[i-k])))); v}
Showing 1-6 of 6 results.