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.

Previous Showing 11-20 of 31 results. Next

A224983 Numbers that are the sum of exactly 8 distinct nonzero squares.

Original entry on oeis.org

204, 221, 236, 240, 249, 255, 260, 261, 268, 269, 272, 276, 279, 281, 284, 285, 288, 289, 293, 295, 296, 299, 300, 303, 305, 306, 309, 311, 312, 316, 317, 320, 321, 323, 324, 325, 326, 327, 329, 332, 333, 335, 336, 337, 338, 339, 340, 341, 344, 345, 347, 348
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 22 2013

Keywords

Examples

			a(1) = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 64 = 204 = A000330(8);
a(2) = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 81 = 221;
a(3) = 1 + 4 + 9 + 16 + 25 + 36 + 64 + 81 = 236;
a(4) = 1 + 4 + 9 + 16 + 25 + 36 + 49 + 100 = 240;
a(5) = 1 + 4 + 9 + 16 + 25 + 49 + 64 + 81 = 249.
		

Crossrefs

Programs

  • Haskell
    a224983 n = a224983_list !! (n-1)
    a224983_list = filter (p 8 $ tail a000290_list) [1..] where
       p k (q:qs) m = k == 0 && m == 0 ||
                      q <= m && k >= 0 && (p (k - 1) qs (m - q) || p k qs m)
  • Mathematica
    nmax = 1000;
    S[n_] := S[n] = Union[Total /@ Subsets[
         Range[Floor[Sqrt[n]]]^2, {8}]][[1 ;; nmax]];
    S[nmax];
    S[n = nmax + 1];
    While[S[n] != S[n - 1], n++];
    S[n] (* Jean-François Alcover, Nov 20 2021 *)

A008935 If 2n = Sum 2^e(k) then a(n) = Sum e(k)^2.

Original entry on oeis.org

1, 4, 5, 9, 10, 13, 14, 16, 17, 20, 21, 25, 26, 29, 30, 25, 26, 29, 30, 34, 35, 38, 39, 41, 42, 45, 46, 50, 51, 54, 55, 36, 37, 40, 41, 45, 46, 49, 50, 52, 53, 56, 57, 61, 62, 65, 66, 61, 62, 65, 66, 70, 71, 74, 75, 77, 78, 81, 82, 86, 87, 90, 91, 49, 50, 53, 54, 58, 59, 62
Offset: 1

Views

Author

Keywords

Examples

			To get a(5), we write 10 = 2 + 8 = 2^1 + 2^3 so a(5) = 1^2 + 3^2 = 10.
		

Crossrefs

Gives A003995 if sorted and duplicates removed.

Programs

  • C
    #include 
    #include 
    #define USAGE "Usage: 'A008935 num'\n where num is the index of the desired ending value in the sequence.\n"
    #define MAX 1023
    #define SHIFT_MAX 9
    int main(int argc, char *argv[]) { unsigned short mask, i, j, end; unsigned long sum; if (argc < 2) { fprintf(stderr, USAGE); return EXIT_FAILURE; } end = atoi(argv[1]); end = (end >= MAX) ? MAX : end;
    fprintf(stdout, "Values: "); for (i = 1; i <= end; i++) { sum = 0; mask = 1; for (j = 0; j < SHIFT_MAX; j++, mask *= 2) if (i & mask) sum += (j+1) * (j+1); fprintf(stdout, "%ld", sum); if (i < end) fprintf(stdout, ","); } fprintf(stdout, "\n"); return EXIT_SUCCESS; }
    
  • Haskell
    a008935 = f 1 where
       f k x | x == 0    = 0
             | r == 0    = f (k+1) x'
             | otherwise = k^2 + f (k+1) x' where (x',r) = divMod x 2
    -- Reinhard Zumkeller, Jul 05 2011
    
  • Maple
    a:= n-> (l-> add(l[i]*i^2, i=1..nops(l)))(convert(n, base, 2)):
    seq(a(n), n=1..80);  # Alois P. Heinz, Nov 20 2019
  • Mathematica
    a[n_] := Total[Flatten[Position[Reverse[IntegerDigits[n, 2]], 1]]^2]; Table[a[n],{n,1,70}] (* Jean-François Alcover  Mar 21 2011 *)
  • Python
    a = lambda n: sum(((k+1)**2) * ((n >> k) & 1) for k in range(0, n.bit_length()))
    print([a(n) for n in range(1,68)]) # Darío Clavijo, Dec 27 2024

Formula

G.f.: 1/(1-x) * Sum_{k>=0} (k+1)^2*x^2^k/(1+x^2^k). - Ralf Stephan, Jun 23 2003

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Mar 22 2000

A317445 Number of permutations of [n] whose lengths of increasing runs are distinct squares.

Original entry on oeis.org

1, 1, 0, 0, 1, 8, 0, 0, 0, 1, 18, 0, 0, 1428, 47998, 0, 1, 32, 0, 0, 9688, 505056, 0, 0, 0, 4085949, 284958912, 0, 0, 290824632172, 28643427712626, 0, 0, 0, 104902510, 9998016202, 1, 72, 23207824626842, 3008268832634364, 182778, 206173972520, 24290829974718, 0
Offset: 0

Views

Author

Alois P. Heinz, Jul 28 2018

Keywords

Crossrefs

Programs

  • Maple
    g:= (n, s)-> `if`(n in s or not issqr(n), 0, 1):
    b:= proc(u, o, t, s) option remember; `if`(u+o=0, g(t, s),
          `if`(g(t, s)=1, add(b(u-j, o+j-1, 1, s union {t})
           , j=1..u), 0)+ add(b(u+j-1, o-j, t+1, s), j=1..o))
        end:
    a:= n-> b(n, 0$2, {}):
    seq(a(n), n=0..50);
  • Mathematica
    g[n_, s_] := If[MemberQ[s, n] || !IntegerQ@Sqrt[n], 0, 1];
    b[u_, o_, t_, s_] := b[u, o, t, s] = If[u + o == 0, g[t, s],
         If[g[t, s] == 1, Sum[b[u - j, o + j - 1, 1, s ~Union~ {t}],
         {j, 1, u}], 0] + Sum[b[u + j - 1, o - j, t + 1, s], {j, 1, o}]];
    a[n_] := b[n, 0, 0, {}];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 24 2021, after Alois P. Heinz *)

Formula

a(n) = 0 <=> n in { A001422 }.
a(n) > 0 <=> n in { A003995 }.

A003999 Sums of distinct nonzero 4th powers.

Original entry on oeis.org

1, 16, 17, 81, 82, 97, 98, 256, 257, 272, 273, 337, 338, 353, 354, 625, 626, 641, 642, 706, 707, 722, 723, 881, 882, 897, 898, 962, 963, 978, 979, 1296, 1297, 1312, 1313, 1377, 1378, 1393, 1394, 1552, 1553, 1568, 1569, 1633, 1634, 1649, 1650, 1921, 1922
Offset: 1

Views

Author

Keywords

Comments

5134240 is the largest positive integer not in this sequence. - Jud McCranie
If we tightened the sequence requirement so that the sum was of more than one 4th power, we would remove exactly 32 4th powers from the terms: row 4 of A332065 indicates which 4th powers would remain. After a(1) = 1, the next number in this sequence that is in the analogous sequences for cubes and squares is a(24) = 881 = A364637(4). - Peter Munn, Aug 01 2023

References

  • The Penguin Dictionary of Curious and Interesting Numbers, David Wells, entry 5134240.

Crossrefs

Cf. A046039 (complement).
Cf. A003995, A003997, A194768, A194769 (analogs for squares, cubes, 5th and 6th powers).
A217844 is a subsequence.

Programs

  • Maple
    (1+x)*(1+x^16)*(1+x^81)*(1+x^256)*(1+x^625)*(1+x^1296)*(1+x^2401)*(1+x^4096)*(1+x^6561)*(1+x^10000)
  • Mathematica
    max = 2000; f[x_] := Product[1 + x^(k^4), {k, 1, 10}]; Exponent[#, x]& /@ List @@ Normal[Series[f[x], {x, 0, max}]] // Rest (* Jean-François Alcover, Nov 09 2012, after Charles R Greathouse IV *)
  • PARI
    upto(lim)={
        lim\=1;
        my(v=List(),P=prod(n=1,lim^(1/4),1+x^(n^4),1+O(x^(lim+1))));
        for(n=1,lim,if(polcoeff(P,n),listput(v,n)));
        Vec(v)
    }; \\ Charles R Greathouse IV, Sep 02 2011

Formula

For n > 4244664, a(n) = n + 889576. - Charles R Greathouse IV, Sep 02 2011

A372579 Number of permutations of [n] such that the number of cycles of length k is zero or equals k for every k.

Original entry on oeis.org

1, 1, 0, 0, 3, 15, 0, 0, 0, 2240, 22400, 0, 0, 4804800, 67267200, 0, 3405402000, 57891834000, 0, 0, 49497518070000, 1039447879470000, 0, 0, 0, 56947245360343962624, 1480628379368943028224, 0, 0, 4057662073660588368847872, 121729862209817651065436160, 0, 0, 0
Offset: 0

Views

Author

Alois P. Heinz, Jul 04 2024

Keywords

Examples

			a(5) = 15 = 5*3: (1)(23)(45), (1)(24)(35), (1)(25)(34), ..., (1,2)(3,4)(5),
  (1,3)(2,4)(5), (1,4)(2,3)(5).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(`if`(j=0 or j=i, b(n-i*j, i-1)*(i-1)!^j/j!*
          combinat[multinomial](n, i$j, n-i*j), 0), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);

Formula

a(n) = 0 <=> n in { A001422 }.
a(n) > 0 <=> n in { A003995 }.

A374321 Number of partitions of [n] such that the number of blocks of size k is zero or equals k for every k.

Original entry on oeis.org

1, 1, 0, 0, 3, 15, 0, 0, 0, 280, 2800, 0, 0, 600600, 8408400, 0, 2627625, 44669625, 0, 0, 38192529375, 802043116875, 0, 0, 0, 1508282884484376, 39215354996593776, 0, 0, 107469680368165243128, 3224090411044957293840, 0, 0, 0, 76290792475347121351680
Offset: 0

Views

Author

Alois P. Heinz, Jul 04 2024

Keywords

Examples

			a(0) = 1: the empty partition.
a(1) = 1: 1.
a(4) = 3: 12|34, 13|24, 14|23.
a(5) = 15: 12|34|5, 12|35|4, 12|3|45, 13|24|5, 13|25|4, 13|2|45, 14|23|5, 15|23|4, 1|23|45, 14|25|3, 14|2|35, 15|24|3, 1|24|35, 15|2|34, 1|25|34.
a(9) = 280: 123|456|789, 123|457|689, 123|458|679, 123|459|678, ..., 169|278|345,  178|269|345, 179|268|345, 189|267|345.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
         `if`(i<1, 0, add(`if`(j=0 or j=i, b(n-i*j, i-1)/j!*
          combinat[multinomial](n, i$j, n-i*j), 0), j=0..n/i)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..35);

Formula

a(n) = 0 <=> n in { A001422 }.
a(n) > 0 <=> n in { A003995 }.

A097757 Table read by rows where row n consists of integers that can be expressed as the sum of distinct squares in exactly n ways.

Original entry on oeis.org

2, 3, 6, 7, 8, 11, 12, 15, 18, 19, 22, 23, 24, 27, 28, 31, 32, 33, 43, 44, 47, 48, 60, 67, 72, 76, 92, 96, 108, 112, 128, 0, 1, 4, 5, 9, 10, 13, 14, 16, 17, 20, 21, 34, 35, 36, 37, 38, 39, 40, 42, 51, 52, 55, 56, 57, 58, 59, 63, 64, 68, 71, 73, 80, 83, 88, 97, 124, 132, 25, 26, 29
Offset: 0

Views

Author

Ray Chandler, Sep 06 2004

Keywords

Comments

Row 0 is A001422.
Only positive squares are allowed, not 0. The inclusion of 0 in row 1 is for the empty sum, not for a sum with a single 0. - Franklin T. Adams-Watters, Sep 20 2009

Examples

			Table begins:
Row 0: 2, 3, 6, 7, 8, 11, 12, 15, 18, 19, 22, 23, 24, 27, 28, 31, 32, 33, 43, 44, 47, 48, 60, 67, 72, 76, 92, 96, 108, 112, 128;
Row 1: 0, 1, 4, 5, 9, 10, 13, 14, 16, 17, 20, 21, 34, 35, 36, 37, 38, 39, 40, 42, 51, 52, 55, 56, 57, 58, 59, 63, 64, 68, 71, 73, 80, 83, 88, 97, 124, 132;
Row 2: 25, 26, 29, 30, 41, 45, 46, 49, 53, 54, 61, 69, 70, 77, 79, 82, 84, 87, 93, 103, 107, 133, 144, 148, 188;
Row 3: 50, 62, 66, 75, 81, 85, 86, 89, 91, 95, 98, 99, 100, 102, 104, 109, 113, 116, 118, 119, 123, 136, 137, 140, 152, 157, 172, 176, 177, 192;
Row 4: 65, 74, 78, 101, 105, 106, 111, 115, 117, 120, 121, 122, 127, 141, 153, 160, 164, 168, 193;
Row 5: 94, 125, 129, 131, 143, 145, 149, 156, 161, 163, 167, 173, 197, 213;
Row 6: 90, 114, 134, 135, 138, 139, 147, 180, 181, 208, 212, 217, 228;
Row 7: 110, 142, 151, 154, 158, 169, 184, 189, 204, 224;
Row 8: 155, 159, 162, 165, 166, 182, 187, 196, 201, 202, 203, 216, 229, 233, 240, 252, 253;
Row 9: 126, 130, 146, 150, 171, 178, 179, 183, 185, 200, 209, 236, 237, 241, 288;
Row 10: 191, 205, 218, 232, 249, 257;
Row 11: 170, 175, 198, 207, 220, 221, 227, 245, 272, 277, 293;
Row 12: 186, 214, 225, 244, 248, 268, 297;
Row 13: 174, 199, 223, 256, 265, 292;
Row 14: 190, 194, 206, 215, 261, 269, 273, 281, 313, 317;
Row 15: 211, 219, 242, 262, 301;
Row 16: 195, 222, 239, 243, 276, 278, 289, 333;
Row 17: 226, 230, 238, 264, 266, 284;
Row 18: 210, 258, 263, 267, 285, 304, 308, 337;
Row 19: 231, 246, 254, 260, 357;
Row 20: 234, 247, 251, 282, 305, 309, 353;
Row 21: 235, 250, 280, 298, 321, 329;
Row 22: 332.
Denoting r(n) the index of the row of the number n, among n = {350, ..., 1000} the only r-values below 28 are a(357) = 19, a(353) = 20, a(373) = 25, a(397) = 26, a(362) = 27, and all n >= 400 have r(n) > 30. So the above rows appear to be complete, and rows 23 & 24 would be empty, as would be rows 39 & 40 unless they have elements > 1000. - _M. F. Hasler_, May 26 2020
		

Crossrefs

Programs

  • PARI
    {r(n,m=n)=sum(x=1,min(sqrtint(n),m),r(n-x^2,x-1),!n)} \\ Gives index of the row in which number n is listed. - M. F. Hasler, May 26 2020

A097758 Greatest integer that can be written as a sum of distinct squares in exactly n ways, or -1 if no such number exists.

Original entry on oeis.org

128, 132, 188, 192, 193, 213, 228, 224, 253, 288, 257, 293, 297, 292, 317, 301, 333, 284, 337, 357, 353, 329, 332, 349, 336, 373, 397, 362, 393, 372, 377, 413, 368, 365, 388, 389, 417, 437, 433, 319, 343, 421, 405, 457, 453, 364, 408, 351, 432, 402, 473
Offset: 0

Views

Author

Ray Chandler, Sep 06 2004

Keywords

Comments

Trailing edge of table described in A097757; leading edge is A097563.

Crossrefs

A097759 Number of integers that can be written as a sum of distinct squares in exactly n ways.

Original entry on oeis.org

31, 38, 25, 30, 19, 14, 13, 10, 17, 15, 6, 11, 7, 6, 10, 5, 8, 6, 8, 5, 7, 6, 1, 4, 4, 10, 3, 7, 7, 3, 4, 5, 3, 6, 5, 2, 5, 3, 2, 1, 2, 8, 1, 3, 5, 1, 4, 1, 4, 2, 4, 7, 2, 2, 2, 4, 1, 1, 5, 1, 2, 2, 5, 2, 3, 2, 2, 2, 0, 1, 5, 2, 3, 1, 1, 1, 2, 2, 6, 1, 4, 0, 2, 1, 3, 1, 3, 4, 0, 2, 4, 5, 1, 1, 1, 0, 2, 1
Offset: 0

Views

Author

Ray Chandler, Sep 06 2004

Keywords

Comments

Number of terms in row n of table described in A097757.

Crossrefs

A097760 Index of zero values in A097759; also index of -1 values in A097563 and A097758.

Original entry on oeis.org

68, 81, 88, 95, 99, 104, 107, 115, 116, 118, 126, 134, 139, 149, 150, 152, 153, 157, 163, 164, 169, 177, 178, 180, 181, 184, 193, 197, 204, 207, 208, 209, 211, 212, 215, 217, 220, 225, 226, 227, 228, 229, 230, 231, 232, 236, 237, 238, 239, 244, 246, 247
Offset: 1

Views

Author

Ray Chandler, Sep 06 2004

Keywords

Comments

A097759(a(n))=0; A097758(a(n))=-1; A097563(a(n))=-1.

Crossrefs

Extensions

Offset changed to 1 by Jinyuan Wang, Aug 06 2021
Previous Showing 11-20 of 31 results. Next