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-5 of 5 results.

A152948 a(n) = (n^2 - 3*n + 6)/2.

Original entry on oeis.org

2, 2, 3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80, 93, 107, 122, 138, 155, 173, 192, 212, 233, 255, 278, 302, 327, 353, 380, 408, 437, 467, 498, 530, 563, 597, 632, 668, 705, 743, 782, 822, 863, 905, 948, 992, 1037, 1083, 1130, 1178, 1227, 1277, 1328, 1380
Offset: 1

Views

Author

Keywords

Comments

a(1) = 2; then add 0 to the first number, then 1, 2, 3, 4, ... and so on.
Essentially the same as A022856, A089071 and A133263. - R. J. Mathar, Dec 19 2008
First differences are A001477.
From Vladimir Shevelev, Jan 20 2014: (Start)
If we ignore the zero polygonal numbers, then for n >= 3, a(n) is the minimal k such that the k-th n-gonal number is a sum of two n-gonal numbers (see formula and example).
If the zero polygonal numbers are ignored, then for n >= 4, the a(n)-th n-gonal number is a sum of the (a(n)-1)-th n-gonal number and the (n-1)-th n-gonal number. (End)
Numbers m such that 8m - 15 is a square. - Bruce J. Nicholson, Jul 24 2017

Examples

			a(7)=17. This means that the 17th (positive) heptagonal number 697 (cf. A000566) is the smallest heptagonal number which is a sum of two (positive) heptagonal numbers. We have 697 = 616 + 81 with indices 17, 16, 6 in A000566. - _Vladimir Shevelev_, Jan 20 2014
		

Crossrefs

Programs

  • Magma
    [ (n^2-3*n+6)/2: n in [1..60] ];
    
  • Mathematica
    Array[(#^2 - 3 # + 6)/2 &, 54] (* or *) Rest@ CoefficientList[Series[-x (2 - 4 x + 3 x^2)/(x - 1)^3, {x, 0, 54}],x] (* Michael De Vlieger, Mar 25 2020 *)
  • PARI
    a(n)=(n^2-3*n+6)/2 \\ Charles R Greathouse IV, Sep 28 2015
  • Sage
    [2+binomial(n,2) for n in range(0, 54)] # Zerinvary Lajos, Mar 12 2009
    

Formula

a(n) = a(n-1) + n-2 (with a(1)=2). - Vincenzo Librandi, Nov 26 2010
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: -x*(2 - 4*x + 3*x^2) / (x-1)^3. - R. J. Mathar, Oct 30 2011
Sum_{n>=1} 1/a(n) = 1/2 + 2*Pi*tanh(sqrt(15)*Pi/2)/sqrt(15). - Amiram Eldar, Dec 13 2022
E.g.f.: exp(x)*(6 - 2*x + x^2)/2 - 3. - Stefano Spezia, Nov 14 2024

A180681 T(n,k) is the sum of the hook lengths over the partitions of n with exactly k parts.

Original entry on oeis.org

1, 3, 3, 6, 5, 6, 10, 16, 8, 10, 15, 23, 22, 12, 15, 21, 47, 44, 30, 17, 21, 28, 62, 74, 56, 40, 23, 28, 36, 104, 115, 114, 71, 52, 30, 36, 45, 130, 196, 162, 139, 89, 66, 38, 45, 55, 195, 268, 286, 227, 169, 110, 82, 47, 55, 66, 235, 395, 407, 369, 269, 204, 134, 100, 57, 66
Offset: 1

Views

Author

Wouter Meeussen, Sep 16 2010

Keywords

Comments

Row sums equal A066183 ('Total sum of squares of parts in all partitions of n').
From Omar E. Pol, Mar 20 2018: (Start)
Both column 1 and leading diagonal give A000217, n >= 1.
Both A206561 and A299768 have the same row sums as this triangle.
Apparently the second diagonal gives A133263 without the first term. (End)

Examples

			T(5,3) = 22 since the partitions of 5 in 3 parts are 221 and 311, with hook lengths {{2,4}, {1,3}, {1}} and {{1,2,5}, {2}, {1}} summing to 22.
Triangle T(n,k) begins:
   1;
   3,   3;
   6,   5,   6;
  10,  16,   8,  10;
  15,  23,  22,  12,  15;
  21,  47,  44,  30,  17,  21;
  28,  62,  74,  56,  40,  23,  28;
  36, 104, 115, 114,  71,  52,  30, 36;
  45, 130, 196, 162, 139,  89,  66, 38, 45;
  55, 195, 268, 286, 227, 169, 110, 82, 47, 55;
		

Crossrefs

T(2n-1,n) gives A301499.

Programs

  • Maple
    f:= n-> (n-1)*n/2:
    b:= proc(n, i) option remember; `if`(n=0 or i=1, [1, n+f(n)],
          b(n, i-1)+(p-> p+[0, p[1]*(n+f(i))])(b(n-i, min(n-i, i))))
        end:
    T:= (n, k)-> (p-> p[1]*(n+f(k))+p[2])(b(n-k, min(n-k, k))):
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Mar 20 2018
  • Mathematica
    (*Needs["DiscreteMath`Combinatorica`"]; hooklength[(p_)?PartitionQ] := Block[{ferr = (PadLeft[1 + 0*Range[ #1], Max[p]] & ) /@ p}, DeleteCases[(Rest[FoldList[Plus, 0, #1]] & ) /@ ferr + Reverse /@ Reverse[Transpose[(Rest[FoldList[Plus, 0, #1]] & ) /@ Reverse[Reverse /@ Transpose[ferr]]]], 0, {2}] - 1]; partitionexact[n_, m_] := TransposePartition /@ (Prepend[ #1, m] & ) /@ Partitions[n - m, m] *); Table[Tr[ Tr[ Flatten[hooklength[ # ]]] &/@ partitionexact[n,k] ] ,{n,16},{k,n}]
    (* Second program: *)
    Table[p = IntegerPartitions[n, {k}]; Total@Table[y = Table[Boole[p[[l]][[i]] >= j], {i, k}, {j, n}]; Total[Table[Total[{y[[i, j ;; n]], y[[i + 1 ;; k, j]]}, 2], {i, k}, {j, n}], 2], {l, Length[p]}], {n, 11}, {k, n}] // Flatten (* Robert Price, Jun 19 2020 *)
    f[n_] := n(n-1)/2;
    b[n_, i_] := b[n, i] = If[n == 0 || i == 1, {1, n + f[n]}, b[n, i - 1] + Function[p, p + {0, p[[1]] (n + f[i])}][b[n - i, Min[n - i, i]]]];
    T[n_, k_] := Function[p, p[[1]] (n + f[k]) + p[[2]]][b[n-k, Min[n-k, k]]];
    Table[Table[T[n, k], {k, 1, n}], {n, 1, 14}] // Flatten (* Jean-François Alcover, Dec 12 2020, after Alois P. Heinz *)

A228446 a(n) = smallest prime p such that 2*n+1 = p + x*(x+1) for some positive integer x, or -1 if no such prime exists.

Original entry on oeis.org

3, 5, 3, 5, 7, 3, 5, 7, 19, 3, 5, 7, 17, 11, 3, 5, 7, 19, 11, 13, 3, 5, 7, 31, 11, 13, 37, 3, 5, 7, 23, 11, 13, 29, 17, 3, 5, 7, 61, 11, 13, 31, 17, 19, 3, 5, 7, 43, 11, 13, 103, 17, 19, 109, 3, 5, 7, 29, 11, 13, 53, 17, 19, 41, 23, 3, 5, 7, 31, 11, 13, 37
Offset: 2

Views

Author

Bill McEachen, Oct 26 2013

Keywords

Comments

Based on Sun's conjecture 1.4 in the paper referenced below.
The plot shows an ever-widening band of sawtooth shape. New maxima values will include sequence members larger than the largest prime factor of the original n. For example when n = 21 with prime factors 3 and 7, and a(10) = 19.
a(A000124(n)) = 3; a(A133263(n)) = 5; a(A167614(n)) = 7. - Reinhard Zumkeller, Mar 12 2014

Examples

			21 = 19+1*2 where no solution exists using p = 2, 3, 5, 7, 11, 13, 17. So a(10) = 19.
51 = 31+4*5 where no lower odd prime provides a solution. So a(25) = 31.
		

References

  • Z. W. Sun, On sums of primes and triangular numbers, Journal of Combinatorics and Number Theory 1(2009), no. 1, 65-76. (See Conjecture 1.4.)

Crossrefs

Programs

  • Haskell
    a228446 n = head
       [q | let m = 2 * n + 1,
            q <- map (m -) $ reverse $ takeWhile (< m) $ tail a002378_list,
            a010051 q == 1]
    -- Reinhard Zumkeller, Mar 12 2014
  • Mathematica
    nn = 14; ob = Table[n*(n+1), {n, nn}]; Table[p = Min[Select[n - ob, # > 0 && PrimeQ[#] &]]; p, {n, 5, ob[[-1]], 2}] (* T. D. Noe, Oct 27 2013 *)
  • PARI
    a(n) = {oddn = 2*n+1; x = oddn; while (! isprime(oddn - x*(x+1)), x--); oddn - x*(x+1);} \\ Michel Marcus, Oct 27 2013
    

Extensions

Entry revised by N. J. A. Sloane, Nov 11 2020 (including addition of escape clause).

A367849 Lexicographically earliest infinite sequence of positive integers such that for each n, the values in a path of locations starting from any i=n are all distinct, where jumps are allowed from location i to i+a(i).

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 1, 4, 1, 1, 2, 5, 3, 1, 1, 4, 6, 1, 1, 5, 1, 1, 7, 1, 6, 1, 1, 2, 1, 8, 7, 1, 1, 2, 1, 3, 1, 9, 4, 1, 1, 2, 5, 3, 1, 1, 10, 6, 1, 1, 2, 1, 3, 7, 1, 4, 11, 1, 1, 5, 8, 1, 1, 2, 6, 3, 1, 12, 9, 1, 7, 1, 1, 2, 1, 3, 1, 10, 4, 13, 1, 1, 5, 1, 1, 2, 1, 11, 1, 1, 2, 1, 14, 1, 1, 2, 1, 3
Offset: 1

Views

Author

Neal Gersh Tolunsky, Dec 08 2023

Keywords

Comments

Consider each index i as a location from which one can jump a(i) terms forward. No starting index can reach the same value more than once by forward jumps.
The value a(i) at the starting index is not part of the path (and thus allows a(2)=1).
The indices of first occurrences are given by A133263 (essentially triangular numbers + 2).
Changing the definition so that jumps are allowed only from location i to i-a(i) gives A002260.

Examples

			We can see, for example, that the terms reachable by jumping forward continuously from i=1 are all distinct (and in this case are just the positive integers):
  1, 1, 2, 1, 3, 1, 1, 4, 1, 1, 2, 5
  *->1->2---->3------->4---------->5
Beginning at i=9 and jumping forward continuously, we get the sequence 1,2,3,4,5,6,7,9 (in which all terms are likewise distinct).
		

Crossrefs

Cf. A367467, A367832, A133263 (index of first occurrences), A362248.

Programs

  • MATLAB
    function a = A367849( max_n )
        a = zeros(1,max_n); j = find(a == 0,1);
        while ~isempty(j)
            a(j) = 1; k = 1;
            if j+k < max_n
                while a(j+k) == 0
                    a(j+k) = k;
                    if j+2*k-1 < max_n
                        j = j+(k-1); k = k+1;
                    else
                        break;
                    end
                end
            end
            j = find(a == 0,1);
        end
    end % Thomas Scheuerle, Dec 09 2023

Formula

a(A133263(n)) = n + 1.

A238531 Expansion of (1 - x + x^2)^2 / (1 - x)^3 in powers of x.

Original entry on oeis.org

1, 1, 3, 5, 8, 12, 17, 23, 30, 38, 47, 57, 68, 80, 93, 107, 122, 138, 155, 173, 192, 212, 233, 255, 278, 302, 327, 353, 380, 408, 437, 467, 498, 530, 563, 597, 632, 668, 705, 743, 782, 822, 863, 905, 948, 992, 1037, 1083, 1130, 1178, 1227, 1277, 1328, 1380
Offset: 0

Views

Author

Michael Somos, Feb 28 2014

Keywords

Comments

Essentially the same as A152948, A133263 and A089071. - R. J. Mathar, Mar 30 2014

Examples

			G.f. = 1 + x + 3*x^2 + 5*x^3 + 8*x^4 + 12*x^5 + 17*x^6 + 23*x^7 + 30*x^8 + ...
		

Crossrefs

Cf. A133263.

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x+x^2)^2/(1-x)^3)); // G. C. Greubel, Aug 07 2018
  • Mathematica
    a[ n_] := (n^2 - n) / 2 + If[ n == 0 || n == 1, 1, 2];
    CoefficientList[Series[(1-x+x^2)^2/(1-x)^3, {x, 0, 50}], x] (* G. C. Greubel, Aug 07 2018 *)
  • PARI
    {a(n) = (n^2 - n) / 2 + 2 - (n==0) - (n==1)};
    
  • PARI
    {a(n) = if( n<0, n = 1-n); polcoeff( (1 - x + x^2)^2 / (1 - x)^3 + x * O(x^n), n)};
    

Formula

Euler transform of length 6 sequence [1, 2, 2, 0, 0, -2].
Binomial transform of [1, 0, 2, -2, 3, -4, 5, -6, ...].
a(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n.
G.f.: (1 - x + x^2)^2 / (1 - x)^3.
a(n) = a(1 - n) for all n in Z.
a(n + 1) = A133263(n) if n>=0. a(n) = (n^2 - n) / 2 + 2 unless n=0 or n=1.
(1 + x^2 + x^3 + x^4 + ...)*(1 + x + 2x^2 + 3x^3 + 4x^4 + ...) = (1 + x + 3x^2 + 5x^3 + 8x^4 + 12x^5 + ...). - Gary W. Adamson, Jul 27 2010
Showing 1-5 of 5 results.