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: Roger Cuculière

Roger Cuculière's wiki page.

Roger Cuculière has authored 15 sequences. Here are the ten most recent ones:

A217446 Sum of the squares of numbers obtained by digit permutations of the concatenation of first n numbers.

Original entry on oeis.org

1, 585, 331668, 213208980, 156226437720, 129158041750920, 119164964083502400, 121503028361696976960, 135757575541042424323200, 165013333307050666667644800, 216831999996550400000012812800, 306342399999513113600000180544000, 463124479999926454528000002723302400
Offset: 1

Author

Roger Cuculière, Oct 03 2012

Keywords

Examples

			a(1) = 1^2 = 1.
a(2) = 12^2 + 21^2 = 585.
a(3) = 123^2 + 132^2 + 213^2 + 231^2 + 312^2 + 321^2 = 331668.
		

Crossrefs

Cf. A071268.

Programs

  • Maple
    R:= n-> (10^n-1)/9: RP:= n-> (10^(2*n)-1)/99:
    a:= n-> (1/12)*(n+1)!*(n*RP(n)+(3*n+2)*R(n)^2):
    seq (a(n), n=1..15);  # Alois P. Heinz, Oct 03 2012

Formula

a(n) = (1/12)*(n+1)!*(n*R'(n)+(3*n+2)*R(n)^2) with R(n) = (10^n-1)/9 and R'(n) = (10^(2*n)-1)/99.

Extensions

More terms from Alois P. Heinz, Oct 03 2012

A132193 Triangle whose n-th row is the list in increasing order of the integers which are the sum of squares of positive integers with sum n. The n-th row begins with n and ends with n^2.

Original entry on oeis.org

0, 1, 2, 4, 3, 5, 9, 4, 6, 8, 10, 16, 5, 7, 9, 11, 13, 17, 25, 6, 8, 10, 12, 14, 18, 20, 26, 36, 7, 9, 11, 13, 15, 17, 19, 21, 25, 27, 29, 37, 49, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 40, 50, 64, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 39, 41, 45, 51, 53, 65, 81
Offset: 0

Author

Roger Cuculière, Nov 05 2007

Keywords

Comments

The n-th row is the list of possible dimensions of the commutant space of an n X n matrix A, i.e. the set of matrices M such that A*M=M*A. The number of elements in the n-th row is given by the sequence A069999. - Corrected by Ricardo C. Santamaria, Nov 08 2012

Examples

			T(4,1)=4 because 4=1+1+1+1 and 1^2+1^2+1^2+1^2=4 ; T(4,2)=6 because 4=2+1+1 and 2^2+1^2+1^2=6.
Triangle T(n,k) begins:
  0;
  1;
  2, 4;
  3, 5,  9;
  4, 6,  8, 10, 16;
  5, 7,  9, 11, 13, 17, 25;
  6, 8, 10, 12, 14, 18, 20, 26, 36;
  7, 9, 11, 13, 15, 17, 19, 21, 25, 27, 29, 37, 49;
  ...
		

Crossrefs

Cf. A069999.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=1, {n},
         {b(n, i-1)[], map(x-> x+i^2, b(n-i, min(n-i, i)))[]})
        end:
    T:= n-> sort([b(n$2)[]])[]:
    seq(T(n), n=0..10);  # Alois P. Heinz, Jun 06 2022
  • Mathematica
    selQ[n_][p_] := MemberQ[#.# & /@ IntegerPartitions[n], p]; row[n_] := Select[Range[n, n^2], selQ[n] ]; Table[row[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, Dec 11 2013 *)

Extensions

More terms from Ricardo C. Santamaria, Nov 08 2012
Row n=0 prepended by Alois P. Heinz, Jun 06 2022

A121234 Nonnegative integers k such that k*(k+1)*(k+2)+1 is a square.

Original entry on oeis.org

0, 2, 4, 55
Offset: 1

Author

Roger Cuculière, Aug 21 2006

Keywords

Comments

The sequence is finite by Thue's theorem n(n + 1)(n + 2) + 1 = n^3 + 3*n^2 + 2*n + 1. The set of k values of integral solutions to the elliptic curve y^2 = n^3 + 3*n^2 + 2*n + 1 (see Magma program) is { -2, -1, 0, 2, 4, 55 }. So the sequence is complete. - Mohamed Bouhamida, Nov 29 2007

Examples

			2 * 3 * 4 + 1 = 25 = 5^2, so 2 is in the sequence.
4 * 5 * 6 + 1 = 121 = 11^2, so 4 is in the sequence.
6 * 7 * 8 + 1 = 337, which is a prime number, so 6 is not in the sequence.
		

Crossrefs

Cf. A258692.

Programs

  • Magma
    P := PolynomialRing(Integers()); {k: k in Sort([ p[1] : p in IntegralPoints(EllipticCurve(n^3 + 3*n^2 + 2*n + 1)) ])}; // Mohamed Bouhamida, Nov 29 2007
    
  • Mathematica
    Select[Range[0,10^5], IntegerQ[Sqrt[#(#+1)(#+2)+1]]&] (* James C. McMahon, Oct 16 2024 *)
  • PARI
    isok(k) = issquare(k*(k+1)*(k+2)+1);  \\ Altug Alkan, Dec 07 2015

A112541 a(n) = Sum_{k=0..n} (n-k)! * n^k.

Original entry on oeis.org

1, 2, 8, 48, 400, 4390, 60624, 1013404, 19881728, 447085170, 11319529600, 318298578664, 9834869311488, 331059072378814, 12055438037135360, 472096504892128500, 19781301201305534464, 882991510898240350666, 41828674437875442696192, 2095750482492627217639360
Offset: 0

Author

Roger Cuculière, Dec 17 2005

Keywords

Comments

This sequence appears in the calculation of the expectation of the number of runs of an n-faced die, stopping when a face appears for the second time.

Crossrefs

Cf. A000142.

Programs

  • Magma
    [(&+[Factorial(k)*n^(n-k): k in [0..n]]): n in [0..20]]; // G. C. Greubel, Jan 12 2022
    
  • Maple
    A112541 := proc(n)
        add((n-k)!*n^k,k=0..n) ;
    end proc:
    seq(A112541(n),n=0..13) ; # R. J. Mathar, Dec 16 2015
  • Mathematica
    a[n_]:= Sum[(n-k)!n^k, {k, 0, n}]; Array[a, 17] (* Robert G. Wilson v, Dec 22 2005 *)
  • PARI
    a(n) = my(A = 1, B = 1); for(k=1, n, B *= n; A = (n-k+1)*A + B); A \\ Mikhail Kurkov, Aug 09 2025
  • Sage
    [sum(factorial(k)*n^(n-k) for k in (0..n)) for n in (0..20)] # G. C. Greubel, Jan 12 2022
    

Formula

a(n) = Sum_{k=0..n} k! * n^(n-k). - G. C. Greubel, Jan 12 2022

Extensions

Corrected and extended by Robert G. Wilson v, Dec 22 2005

A089216 Number of triples (x,y,z) of integers such that 0 <= x <= y < n, 0 <= z < n, n^2 = x^2 + y^2 - z^2.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 3, 3, 2, 2, 5, 3, 5, 4, 4, 4, 7, 4, 7, 7, 6, 6, 10, 6, 9, 9, 9, 11, 10, 7, 12, 11, 12, 10, 16, 10, 16, 13, 11, 15, 18, 13, 18, 17, 17, 16, 23, 16, 17, 16, 18, 20, 24, 17, 26, 25, 21, 22, 24
Offset: 1

Author

Roger Cuculière, Dec 10 2003

Keywords

Comments

For any integer n>=7, there exist integers x, y, z such that 0 <= x < n, 0 <= y < n, 0 <= z < n, n^2 = x^2 + y^2 - z^2. Hence the only functions f of the positive integers into themselves such that f(m^2+n^2) = f(m)^2 + f(n)^2 are the identity and the null function.

Programs

  • Mathematica
    r[n_] := Reduce[n^2 == x^2 + y^2 - z^2 && 0 <= x <= y < n && 0 <= z < n, {x, y, z}, Integers]; Reap[For[n = 1, n <= 100, n++, rn = r[n]; w = Which[rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1; Print[n, " error"]]; Print[w]; Sow[w]]][[2, 1]] (* Jean-François Alcover, Jan 21 2016 *)

Extensions

More terms from Jean-François Alcover, Jan 21 2016

A084916 Positive numbers of the form k = x^2 - 3*y^2.

Original entry on oeis.org

1, 4, 6, 9, 13, 16, 22, 24, 25, 33, 36, 37, 46, 49, 52, 54, 61, 64, 69, 73, 78, 81, 88, 94, 96, 97, 100, 109, 117, 118, 121, 132, 141, 142, 144, 148, 150, 157, 166, 169, 177, 181, 184, 193, 196, 198, 208, 213, 214, 216, 222, 225, 229, 241, 244, 249, 253, 256
Offset: 1

Author

Roger Cuculière, Jul 14 2003

Keywords

Comments

Equivalently, positive numbers of the form k = x^2 + 2xy - 2y^2. These are equivalent forms, of discriminant 12.
Also numbers representable as x^2 + 4*x*y + y^2 with 0 <= x <= y. - Gheorghe Coserea, Jul 29 2018 [The restriction 0 <= x <= y is not necessary. - Klaus Purath, Feb 05 2023]
From Klaus Purath, Feb 05 2023: (Start)
Also positive numbers of the form x^2 + 2*m*x*y + (m^2 - 3)*y^2. This includes all forms given above so far.
All terms are congruent to {0, 1, 4, 6, 9, 10} modulo 12.
The product of any two terms belongs to the sequence - (empirically secured up to a(k)*a(m) for 2 <= k, m <= 85). Thus it appears that this sequence is closed under multiplication. Perhaps someone can find a proof? (End)

Crossrefs

Cf. A031363, A035251, A243655 (primitive representations).
See A068228 for primes.

Programs

  • Mathematica
    Reap[For[n = 1, n < 300, n++, If[Reduce[n == x^2 - 3*y^2, {x, y}, Integers] =!= False, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Dec 03 2013 *)

Extensions

More terms from Reinhard Zumkeller, Jul 17 2003

A084917 Positive numbers of the form 3*y^2 - x^2.

Original entry on oeis.org

2, 3, 8, 11, 12, 18, 23, 26, 27, 32, 39, 44, 47, 48, 50, 59, 66, 71, 72, 74, 75, 83, 92, 98, 99, 104, 107, 108, 111, 122, 128, 131, 138, 143, 146, 147, 156, 162, 167, 176, 179, 183, 188, 191, 192, 194, 200, 207, 218, 219, 227, 234, 236, 239, 242, 243, 251, 263, 264, 275, 282, 284
Offset: 1

Author

Roger Cuculière, Jul 14 2003

Keywords

Comments

Positive integers k such that x^2 - 4xy + y^2 + k = 0 has integer solutions. (See the CROSSREFS section for sequences relating to solutions for particular k.)
Comments on method used, from Colin Barker, Jun 06 2014: (Start)
In general, we want to find the values of f, from 1 to 400 say, for which x^2 + bxy + y^2 + f = 0 has integer solutions for a given b.
In order to solve x^2 + bxy + y^2 + f = 0 we can solve the Pellian equation x^2 - Dy^2 = N, where D = b*b - 4 and N = 4*(b*b - 4)*f.
But since sqrt(D) < N, the classical method of solving x^2 - Dy^2 = N does not work. So I implemented the method described in the 1998 sci.math reference, which says:
"There are several methods for solving the Pellian equation when |N| > sqrt(d). One is to use a brute-force search. If N < 0 then search on y = sqrt(abs(n/d)) to sqrt((abs(n)(x1 + 1))/(2d)) and if N > 0 search on y = 0 to sqrt((n(x1 - 1))/(2d)) where (x1, y1) is the minimum positive solution (x, y) to x^2 - dy^2 = 1. If N < 0, for each positive (x, y) found by the search, also take (-x, y). If N > 0, also take (x, -y). In either case, all positive solutions are generated from these using (x1, y1) in the standard way."
Incidentally all my Pell code is written in B-Prolog, and is somewhat voluminous. (End)
Also, positive integers of the form -x^2 + 2xy + 2y^2 of discriminant 12. - N. J. A. Sloane, May 31 2014 [Corrected by Klaus Purath, May 07 2023]
The equivalent sequence for x^2 - 3xy + y^2 + k = 0 is A031363.
The equivalent sequence for x^2 - 5xy + y^2 + k = 0 is A237351.
A positive k does not appear in this sequence if and only if there is no integer solution of x^2 - 3*y^2 = -k with (i) 0 < y^2 <= k/2 and (ii) 0 <= x^2 <= k/2. See the Nagell reference Theorems 108 a and 109, pp. 206-7, with D = 3, N = k and (x_1,y_1) = (2,1). - Wolfdieter Lang, Jan 09 2015
From Klaus Purath, May 07 2023: (Start)
There are no squares in this sequence. Products of an odd number of terms as well as products of an odd number of terms and any terms of A014209 belong to the sequence.
Products of an even number of terms are terms of A014209. The union of this sequence and A014209 is closed under multiplication.
A positive number belongs to this sequence if and only if it contains an odd number of prime factors congruent to {2, 3, 11} modulo 12. If it contains prime factors congruent to {5, 7} modulo 12, these occur only with even exponents. (End)
From Klaus Purath, Jul 09 2023: (Start)
Any term of the sequence raised to an odd power also belongs to the sequence. Proof: t^(2n+1) = t*t^2n = (3*x^2 - y^2)*t^2n = 3*(x*t^n)^2 - (y*t^n)^2. It seems that t^(2n+1) occurs only if t also is in the sequence.
Joerg Arndt has proved that there are no squares in this sequence: Assume s^2 = 3*y^2 - x^2, then s^2 + x^2 = 3 * y^2, but the sum of two squares cannot be 3 * y^2, qed. (End)
That products of any 3 terms belong to the sequence can be proved by the following identity: (na^2 - b^2) (nc^2 - d^2) (ne^2 - f^2) = n[a(nce + df) + b(cf + de)]^2 - [na(cf + de) + b(nce + df)]^2. This can be verified by expanding both sides of the equation. - Klaus Purath, Jul 14 2023

Examples

			11 is in the sequence because 3 * 3^2 - 4^2 = 27 - 16 = 11.
12 is in the sequence because 3 * 4^2 - 6^2 = 48 - 36 = 12.
13 is not in the sequence because there is no solution in integers to 3y^2 - x^2 = 13.
From _Wolfdieter Lang_, Jan 09 2015: (Start)
Referring to the Jan 09 2015 comment above.
k = 1 is out because there is no integer solution of (i) 0 < y^2 <= 1/2.
For k = 4, 5, 6, and 7 one has y = 1, x = 0, 1 (and the negative of this). But x^2 - 3 is not -k for these k and x values. Therefore, these k values are missing.
For k = 8 .. 16 one has y = 1, 2 and x = 0, 1, 2. Only y = 2 has a chance and only for k = 8, 11 and 12 the x value 2, 1 and 0, respectively, solves x^2 - 12 = -k. Therefore 9, 10, 13, 14, 15, 16 are missing.
... (End)
		

References

  • T. Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964.

Crossrefs

With respect to solutions of the equation in the early comment, see comments etc. in: A001835 (k = 2), A001075 (k = 3), A237250 (k = 11), A003500 (k = 12), A082841 (k = 18), A077238 (k = 39).
A141123 gives the primes.
For a list of sequences giving numbers and/or primes represented by binary quadratic forms, see the "Binary Quadratic Forms and OEIS" link.

Programs

  • Mathematica
    r[n_] := Reduce[n == 3*y^2 - x^2 && x > 0 && y > 0, {x, y}, Integers]; Reap[For[n = 1, n <= 1000, n++, rn = r[n]; If[rn =!= False, Print["n = ", n, ", ", rn /. C[1] -> 1 // Simplify]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Jan 21 2016 *)
    Select[Range[300],Length[FindInstance[3y^2-x^2==#,{x,y},Integers]]>0&] (* Harvey P. Dale, Apr 23 2023 *)

Extensions

Terms 26 and beyond from Colin Barker, Feb 06 2014

A066858 Smallest k>1 such that for each integer x, x^k=x or x^k=0 (mod n); or 0 if no such k exists.

Original entry on oeis.org

2, 3, 3, 5, 3, 7, 3, 7, 5, 11, 0, 13, 7, 5, 5, 17, 0, 19, 0, 7, 11, 23, 0, 21, 13, 19, 0, 29, 5, 31, 9, 11, 17, 13, 0, 37, 19, 13, 0, 41, 7, 43, 0, 0, 23, 47, 0, 43, 0, 17, 0, 53, 0, 21, 0, 19, 29, 59, 0, 61, 31, 0, 17, 13, 11, 67, 0, 23, 13, 71, 0, 73, 37, 0, 0, 31, 13, 79, 0, 55, 41
Offset: 2

Author

Roger Cuculière, Jan 22 2002

Keywords

Comments

By Fermat's little theorem if k exists then k <= n (with equality only if n prime). All terms that are 0 are not squarefree and not prime powers. - Larry Reeves

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jun 11 2002

A061065 For n <= 6, entry of maximal modulus in the inverse of the n-th Hilbert matrix. For n >= 3, this is the (n-1,n-1)-th entry.

Original entry on oeis.org

1, 12, 192, 6480, 179200, 4410000, 100590336, 2175421248, 45229916160, 912328045200, 17965673440000, 346945899203904, 6592659294154752, 123580568462478400, 2289795064260480000, 42003815644116000000
Offset: 1

Author

Roger Cuculière, May 28 2001

Keywords

Comments

Incorrect version of the largest element in the inverse of Hilbert's matrix. See A210356 for the correct version. See A210357 for the location of the maximal value. - T. D. Noe and Clark Kimberling, Mar 28 2012

Crossrefs

Programs

  • PARI
    { for (n=1, 100, if (n>2, a=((2*n-2)^2)*(2*n-3)*binomial(2*n-4, n-2)^2, if (n==1, a=1, a=12)); write("b061065.txt", n, " ", a) ) } \\ Harry J. Smith, Jul 17 2009

Formula

For n >= 3, a(n) = ((2n-2)^2)*(2n-3)*C(2n-4, n-2)^2. - David Wasserman, Jun 08 2002

Extensions

More terms from David Wasserman, Jun 08 2002

A073044 Triangle read by rows: T(n,k) (n >= 1, n-1 >= k >= 0) = number of n-sequences of 0's and 1's with no pair of adjacent 0's and exactly k pairs of adjacent 1's.

Original entry on oeis.org

2, 2, 1, 2, 2, 1, 2, 3, 2, 1, 2, 4, 4, 2, 1, 2, 5, 6, 5, 2, 1, 2, 6, 9, 8, 6, 2, 1, 2, 7, 12, 14, 10, 7, 2, 1, 2, 8, 16, 20, 20, 12, 8, 2, 1, 2, 9, 20, 30, 30, 27, 14, 9, 2, 1, 2, 10, 25, 40, 50, 42, 35, 16, 10, 2, 1, 2, 11, 30, 55, 70, 77, 56, 44, 18, 11, 2, 1, 2, 12, 36, 70, 105, 112, 112, 72
Offset: 1

Author

Roger Cuculière, Aug 24 2002

Keywords

Comments

T(n,k) is the number of domino tilings of 2 X (n+1) rectangles that have n+2-k perimeter dominoes. - Bridget Tenner, Oct 14 2019

Examples

			T(5,2)=4 because the sequences of length 5 with 2 pairs 11 are 11101, 11011,10111, 01110. Also the 2 X (5+1) rectangle has 4 domino tilings with 5+2-2 perimeter dominoes. - _Bridget Tenner_, Oct 14 2019
Triangle starts:
  2;
  2, 1;
  2, 2, 1;
  2, 3, 2, 1;
  2, 4, 4, 2, 1;
		

References

  • S. J. Cyvin and I. Gutman, Kekulé structures in benzenoid hydrocarbons, Lecture Notes in Chemistry, No. 46, Springer, New York, 1988 (see pp. 67-68).
  • I. Goulden and D. Jackson, Combinatorial Enumeration, John Wiley and Sons, 1983, page 76.

Crossrefs

Row sums are the Fibonacci numbers (A000045).
Cf. A046854.
Weighted row sums 2*T(n,n) + 3*T(n,n-1) + 4*T(n,n-2) + ... give A320947. - Bridget Tenner, Oct 14 2019

Programs

  • Maple
    G:=z*(2+2*z-t*z)/(1-t*z-z^2):Gser:=simplify(series(G,z=0,17)):for n from 1 to 15 do P[n]:=sort(coeff(Gser,z^n)) od:for n from 1 to 13 do seq(coeff(t*P[n],t^k),k=1..n) od;# yields sequence in triangular form
  • Mathematica
    nn = 15; f[list_] := Select[list, # > 0 &]; Map[f, Drop[CoefficientList[Series[(1 + x) (1 + x - y x)/(1 - y x - x^2), {x, 0, nn}], {x,y}], 1]] //Flatten (* Geoffrey Critzer, Mar 05 2012 *)
  • PARI
    T(n,k) = binomial((n+k-1)\2,k) + binomial((n+k-2)\2,k) \\ Charles R Greathouse IV, Jun 07 2016

Formula

Recurrence: T(n, k) = T(n-1, k-1) + T(n-2, k).
G.f.: G(t, z) = z*(2+2*z-t*z)/(1-t*z-z^2). - Emeric Deutsch, Feb 01 2005
T(n,k) = binomial(floor((n+k-1)/2),k) + binomial(floor((n+k-2)/2),k). - Jeremy Dover, Jun 07 2016
T(n,k) = A046854(n-1,k) + A046854(n-2,k), where A046854 is extended so that A046854(-1,0) = 1. - Jeremy Dover, Jun 07 2016

Extensions

More terms from Emeric Deutsch, Feb 01 2005