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 31-40 of 50 results. Next

A082039 Symmetric square array defined by T(n,k) = k^2*n^2 + k*n + 1, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 7, 1, 1, 13, 21, 13, 1, 1, 21, 43, 43, 21, 1, 1, 31, 73, 91, 73, 31, 1, 1, 43, 111, 157, 157, 111, 43, 1, 1, 57, 157, 241, 273, 241, 157, 57, 1, 1, 73, 211, 343, 421, 421, 343, 211, 73, 1, 1, 91, 273, 463, 601, 651, 601, 463, 273, 91, 1, 1, 111, 343, 601, 813, 931, 931, 813, 601, 343, 111, 1
Offset: 0

Views

Author

Paul Barry, Apr 02 2003

Keywords

Examples

			Square array T(n,k) begins:
  1  1  1   1   1   1 ...
  1  3  7  13  21  31 ...
  1  7 21  43  73 111 ...
  1 13 43  91 157 241 ...
  1 21 73 157 273 421 ...
  ...
		

Crossrefs

Rows include A054569, A002061, A082040, A082041.
Main diagonal is A059826.
Cf. A082038.

A114254 Sum of all terms on the two principal diagonals of a 2n+1 X 2n+1 square spiral.

Original entry on oeis.org

1, 25, 101, 261, 537, 961, 1565, 2381, 3441, 4777, 6421, 8405, 10761, 13521, 16717, 20381, 24545, 29241, 34501, 40357, 46841, 53985, 61821, 70381, 79697, 89801, 100725, 112501, 125161, 138737, 153261, 168765, 185281, 202841, 221477, 241221
Offset: 0

Views

Author

William A. Tedeschi, Feb 06 2008, Mar 01 2008

Keywords

Examples

			For n = 1, the 3 X 3 spiral is
.
       7---8---9
       |
       6   1---2
       |       |
       5---4---3
.
so a(1) = 7 + 9 + 1 + 5 + 3 = 25.
.
For n = 2, the 5 X 5 spiral is
.
  21--22--23--24--25
   |
  20   7---8---9--10
   |   |           |
  19   6   1---2  11
   |   |       |   |
  18   5---4---3  12
   |               |
  17--16--15--14--13
.
so a(2) = 21 + 25 + 7 + 9 + 1 + 5 + 3 + 17 + 13 = 101.
		

Crossrefs

Cf. A016754, A054569, A053755, A054554 for diagonals from origin.
Cf. A325958 (first differences).

Programs

  • Mathematica
    Array[1 + 10 #^2 + (16 #^3 + 26 #)/3 &, 36, 0] (* Michael De Vlieger, Mar 01 2018 *)
  • PARI
    a(n) = 1 + 10*n^2 + (16*n^3 + 26*n)/3; \\ Joerg Arndt, Mar 01 2018

Formula

O.g.f.: 3/(-1+x) + 16/(-1+x)^2 + 44/(-1+x)^3 + 32/(-1+x)^4 = (1 + 21*x + 7*x^2 + 3*x^3)/(-1+x)^4. - R. J. Mathar, Feb 10 2008
a(n) = 1 + 10*n^2 + (16*n^3 + 26*n)/3. [Corrected by Arie Groeneveld, Aug 17 2008]

A168026 Noncomposite numbers in the southwestern ray of the Ulam spiral as oriented on the March 1964 cover of Scientific American.

Original entry on oeis.org

1, 7, 43, 73, 157, 211, 421, 601, 1483, 2551, 2971, 3907, 4423, 6163, 6481, 8191, 12211, 19183, 22651, 26407, 27061, 28393, 31153, 35533, 37057, 37831, 42643, 47743, 55933, 60763, 71023, 74257, 77563, 83233, 84391, 98911, 110557, 113233
Offset: 1

Views

Author

Alonso del Arte, Nov 16 2009

Keywords

Comments

From Peter Munn, Mar 17 2018: (Start)
Noncomposites of the form k^2 + k + 1 with k even and nonnegative (and the same values occur with k odd and negative). Equivalently, noncomposites of the form 4k^2 + 2k + 1 with k >= 0, or 4k^2 - 6k + 3 with k > 0.
A073337 lists those of the form k^2 + k + 1 with k odd and positive, and this is equivalently those of the form 4k^2 - 2k + 1 with k > 0.
(End)
Numbers that are the sum of A000217(2*k-3) + A000217(2*k-1) that result in either unity or a prime, for k,n >= 1. For k,n >= 0, a(n+1) = 4*k*2 + 2*k + 1 will give the same results. - J. M. Bergot, May 07 2018

Crossrefs

Cf. A054569, all numbers of the form 4k^2 - 6k + 3 with k > 0. Noncomposites of the eastern ray are in A168022. Primes of the northeastern ray are in A073337. Noncomposites of the northern ray are in A168023. Primes of the northwestern ray are in A121326. Noncomposites of the western ray are in A168025. Noncomposites of the southern ray are in A168027.

Programs

  • Mathematica
    Select[Table[4 n^2 - 6 n + 3, {n, 200}], Length[Divisors[ # ]] < 3 &]
  • PARI
    lista(nn) = {print1(1, ", "); for(k=1, nn, if(isprime(p=4*k^2-6*k+3), print1(p, ", ")));} \\ Altug Alkan, Mar 22 2018

Formula

Numbers of the form 4k^2 - 6k + 3 with k > 0 and no more than two divisors. [corrected by Peter Munn, Mar 17 2018]

A200975 Numbers on the diagonals in Ulam's spiral.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 17, 21, 25, 31, 37, 43, 49, 57, 65, 73, 81, 91, 101, 111, 121, 133, 145, 157, 169, 183, 197, 211, 225, 241, 257, 273, 289, 307, 325, 343, 361, 381, 401, 421, 441, 463, 485, 507, 529, 553, 577, 601, 625, 651, 677, 703, 729, 757, 785, 813, 841, 871, 901
Offset: 1

Views

Author

Ismael Bouya, Nov 25 2011

Keywords

Comments

All entries are odd.
From Bob Selcoe, Oct 22 2014: (Start)
The following hold:
1. a(n) = (2k + 1)^2 when n = 4k + 1, k >= 0
2. a(n) = 4*k^2 + 1 when n = 4k - 1, k > 0
3 a(n) = k^2 + k + 1 when n = 2k, k > 0.
Conjecture 1: there must be at least one prime in [a(n), a(n+1)] inclusive.
Conjecture 2: generally, when j is in [(2m-1)^2+1, (2m+1)^2] inclusive, there must be at least one prime in [j-2m-1, j] inclusive. If true, then Conjecture 1 is true; also suggests A248623, A248835 and Oppermann's conjecture (see A002620) likely are true. (End)

Examples

			The numbers between ** are in this sequence.
.
  *21*--22---23---24--*25*
    |
    |
   20   *7*---8---*9*--10
    |    |              |
    |    |              |
   19    6   *1*---2   11
    |    |         |    |
    |    |         |    |
   18   *5*---4---*3*  12
    |                   |
    |                   |
  *17*--16---15---14--*13*
		

Crossrefs

Cf. A016754, A054554, A053755, and A054569 interleaved, A002620,
Cf. A121658 (complementary)

Programs

  • Mathematica
    Sort@ Flatten@ Table[4n^2 + (2j - 4)n + 1, {j, 0, 3}, {n, 16}] (* Robert G. Wilson v, Jul 10 2014 *)
    a[n_Integer/;n>0]:=Quotient[2 n (n+2)+(-1)^n-4 Mod[n^2 (3 n+2),4,-1]+7,8] (* Todd Silvestri, Oct 25 2014 *)
  • PARI
    al(n)=local(r=vector(n),j);r[1]=1;for(k=2,n,r[k]=r[k-1]+(k+2)\4*2);r /* Franklin T. Adams-Watters, Nov 26 2011 */
  • Python
    # prints all numbers on the diagonals of a sq*sq spiral
    sq = 5
    d = 1
    while 2*d - 1 < sq:
        print(4*d*d - 4*d +1)
        print(4*d*d - 4*d +1 + 1* 2* d)
        print(4*d*d - 4*d +1 + 2* 2* d)
        print(4*d*d - 4*d +1 + 3* 2* d)
        d += 1
    print(sq*sq)
    

Formula

a(4n) = 4n^2 + 2n + 1; a(4n+1) = 4n^2 + 4n + 1; a(4n+2) = 4n^2 + 6n + 3; a(4n+3) = 4n^2 + 8n + 5. [corrected by James Mitchell, Dec 31 2017]
G.f.: -x*(1+x+x^5-x^4) / ( (1+x)*(x^2+1)*(x-1)^3 ). - R. J. Mathar, Nov 28 2011
a(n) = (2*n*(n+2)+(-1)^n-4*sin((Pi*n)/2)+7)/8 = (A249356(n)+7)/8. - Todd Silvestri, Oct 25 2014
a(n) = floor_(n*(n+2)/4) + floor_(n(mod 4)/3) + 1. - Bob Selcoe, Oct 27 2014

Extensions

Edited with more terms by Franklin T. Adams-Watters, Nov 26 2011

A081348 First row in maze arrangement of natural numbers.

Original entry on oeis.org

1, 6, 7, 20, 21, 42, 43, 72, 73, 110, 111, 156, 157, 210, 211, 272, 273, 342, 343, 420, 421, 506, 507, 600, 601, 702, 703, 812, 813, 930, 931, 1056, 1057, 1190, 1191, 1332, 1333, 1482, 1483, 1640, 1641, 1806, 1807, 1980, 1981, 2162, 2163, 2352, 2353, 2550
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Crossrefs

Programs

  • Magma
    [(2*n^2+4*n+3-(2*n+1)*(-1)^n)/2: n in [0..50]]; // Vincenzo Librandi, Aug 08 2013
  • Mathematica
    CoefficientList[Series[(1 + 5 x - x^2 + 3 x^3) / ((1 - x)^3 (1 + x)^2), {x, 0, 60}], x] (* Vincenzo Librandi, Aug 08 2013 *)

Formula

a(n) = (2*n^2+4*n+3-(2*n+1)(-1)^n)/2.
a(2*n) = A054569(n).
a(2*n+1) = 2*A014105(n+1).
G.f.: (1+5*x-x^2+3*x^3)/((1-x)^3*(1+x)^2). - Colin Barker, Apr 17 2012

A168547 a(n) = 1 - 2*n^2 + 4*n*(1 + 2*n^2)/3.

Original entry on oeis.org

1, 3, 17, 59, 145, 291, 513, 827, 1249, 1795, 2481, 3323, 4337, 5539, 6945, 8571, 10433, 12547, 14929, 17595, 20561, 23843, 27457, 31419, 35745, 40451, 45553, 51067, 57009, 63395, 70241, 77563, 85377, 93699, 102545, 111931, 121873, 132387, 143489, 155195
Offset: 0

Views

Author

Paul Curtz, Nov 29 2009

Keywords

Comments

Binomial transform of the quasi-finite sequence 1,2,12,16,0,... (0 continued).
A bisection of A168582.

Programs

Formula

a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
G.f.: (1 - x + 11*x^2 + 5*x^3)/(x-1)^4.
First differences: a(n+1) - a(n) = 2*A054569(n+1).
Second differences: a(n+2) - 2*a(n+1) + a(n) = 4*A004767(n).
Third differences: a(n+3) - 3*a(n+2) + 3*a(n+1) - a(n) = 16.
a(n+1) = A166464(n) + A035597(n+1).
a(n) = 1 - 2*n^2 + 4*A005900(n). - R. J. Mathar, Dec 05 2009
E.g.f.: (1/3)*(3 + 6*x + 18*x^2 + 8*x^3)*exp(x). - G. C. Greubel, Jul 26 2016

Extensions

Edited and extended by R. J. Mathar, Dec 05 2009

A143861 Ulam's spiral (NNE spoke).

Original entry on oeis.org

1, 14, 59, 136, 245, 386, 559, 764, 1001, 1270, 1571, 1904, 2269, 2666, 3095, 3556, 4049, 4574, 5131, 5720, 6341, 6994, 7679, 8396, 9145, 9926, 10739, 11584, 12461, 13370, 14311, 15284, 16289, 17326, 18395, 19496, 20629, 21794, 22991, 24220
Offset: 1

Views

Author

Keywords

Comments

Stanislaw M. Ulam was doodling during the presentation of a "long and very boring paper" at a scientific meeting in 1963. The spiral is its result. Note that conforming to trigonometric conventions, the spiral begins on the abscissa and rotates counterclockwise. Other spirals, orientations, direction of rotation and initial values exist, even in the OEIS.
Also sequence found by reading the segment (1, 14) together with the line from 14, in the direction 14, 59, ..., in the square spiral whose vertices are the generalized decagonal numbers A074377. - Omar E. Pol, Nov 05 2012

References

  • Chris K. Caldwell & G. L. Honaker, Jr., Prime Curios! The Dictionary of Prime Number Trivia, CreateSpace, Sept 2009, pp. 2-3.

Crossrefs

Programs

  • GAP
    List([1..40], n-> ((32*n-35)^2 +55)/64); # G. C. Greubel, Nov 09 2019
  • Magma
    [((32*n-35)^2 +55)/64: n in [1..40]]; // G. C. Greubel, Nov 09 2019
    
  • Maple
    seq( ((32*n-35)^2 +55)/64, n=1..40); # G. C. Greubel, Nov 09 2019
  • Mathematica
    (* From Robert G. Wilson v, Oct 29 2011 *)
    f[n_]:= 16n^2 -35n +20; Array[f, 40]
    LinearRecurrence[{3,-3,1}, {1,14,59}, 40]
    FoldList[#1 + #2 &, 1, 32Range@ 10 - 19] (* End *)
    ((32*Range[40] -35)^2 +55)/64 (* G. C. Greubel, Nov 09 2019 *)
  • PARI
    a(n)=16*n^2-35*n+20 \\ Charles R Greathouse IV, Oct 29 2011
    
  • Sage
    [((32*n-35)^2 +55)/64 for n in (1..40)] # G. C. Greubel, Nov 09 2019
    

Formula

a(n) = 16*n^2 - 35*n + 20. - R. J. Mathar, Sep 08 2008
G.f.: x*(1 + 11*x + 20*x^2)/(1-x)^3. - Colin Barker, Aug 03 2012
E.g.f.: -20 + (20 - 19*x + 16*x^2)*exp(x). - G. C. Greubel, Nov 09 2019

A172979 Primes with locations of right angle turns in Ulam square spiral (primes in A033638).

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 31, 37, 43, 73, 101, 157, 197, 211, 241, 257, 307, 401, 421, 463, 577, 601, 677, 757, 1123, 1297, 1483, 1601, 1723, 2551, 2917, 2971, 3137, 3307, 3541, 3907, 4357, 4423, 4831, 5113, 5477, 5701, 6007, 6163, 6481, 7057, 8011, 8101, 8191, 8837, 9901
Offset: 1

Views

Author

Michel Lagneau, Nov 21 2010

Keywords

Comments

Except for the first term, 2, these are the primes on the main diagonals of the Ulam spiral. - Robert G. Wilson v, Jul 10 2014
Primes p for which floor(sqrt(p)) | (p-1). - Davide Rotondo, Jun 06 2025

Examples

			Ulam square spiral = 7 8 9 / 6 1 2 / 5 4 3 /...; changes of direction (right-angle)
  for the primes at 2 3 5 7 ...
		

Crossrefs

Programs

  • Maple
    with(numtheory): a0:=1:for n from 1 to 200 do : a1:=a0+floor(n/2):a0:=a1:if
      type(a1,prime)=true then printf(`%d, `,a1):else fi:od:
  • Mathematica
    Select[ Sort@ Flatten@ Table[ 4n^2 + (2j - 4)n + 1, {j, 0, 3}, {n, 55}], PrimeQ]
  • PARI
    for(n=0,10^3, my(t=n^2\4+1); if(isprime(t),print1(t,", "))); \\ Joerg Arndt, Jul 12 2014

A337641 One-quarter of the number of regions in the central square of an equal-armed cross with arms of length n (as in A331456).

Original entry on oeis.org

1, 14, 70, 231, 576, 1207, 2255, 3883, 6267, 9588, 14088, 20021, 27667, 37306, 49240, 63859, 81517, 102603, 127545, 156769, 190739, 229932, 274898, 326181, 384332, 449878, 523472, 605766, 697380, 799053, 911449, 1035371, 1171471, 1320566, 1483374, 1660873, 1853819, 2063133, 2289607, 2534326, 2798159
Offset: 0

Views

Author

Keywords

Comments

Without loss of generality, we may assume the central square has vertices (0,0), (1,0), (0,1), (1,1).
Suppose n >= 1. Then all nodes in the graph, whether or not in the central square, have rational coordinates with denominator at most 4*n^2 + 2*n + 1, which for n = 1, 2, 3, ... is 7, 21, 43, 73, 111, ... (cf. A054569).
This maximum is always attained, for example by the node at the intersection of the lines 2*n*x + y = n, joining (0,n) to (1, -n) and -x + (2*n+1)*y = n, joining (-n,0) to (n+1,1).
In the central square, the maximum number of sides in any region is (for n = 0, 1, 2, 3, ...) 3, 4, 6, 6, 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 6, 7, 6, 7, 7, 6, 6, 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, ... We conjecture that 7 is the maximum. - Lars Blomberg, Sep 19 2020.
See A331456 for further illustrations.

Crossrefs

A339237 Decimal expansion of K = Sum_{m>=0} 1/(1 + 2*m + 4*m^2).

Original entry on oeis.org

1, 2, 7, 9, 7, 2, 8, 7, 4, 2, 2, 8, 1, 8, 9, 6, 8, 3, 3, 6, 4, 7, 2, 7, 5, 7, 0, 1, 5, 0, 7, 6, 3, 0, 6, 7, 2, 2, 6, 2, 6, 0, 3, 6, 7, 5, 0, 7, 5, 7, 8, 2, 6, 1, 9, 3, 0, 6, 8, 3, 0, 5, 8, 8, 1, 6, 9, 3, 0, 6, 6, 0, 7, 2, 2, 1, 3, 6, 4, 9, 0, 6, 6, 2, 1, 1, 5, 3, 2, 9, 9, 0, 5, 3, 5, 3, 2, 2, 7, 3, 7, 1, 9, 7, 1, 3, 2, 9, 2, 3
Offset: 1

Views

Author

Artur Jasinski, Nov 28 2020

Keywords

Comments

This constant K and the constant J = A339135 allow the expression of the real and imaginary parts of:
Psi(1/4 + i*sqrt(3)/4) = - J - log(2)/3 - (1/2)*Pi/cosh(Pi*sqrt(3)/2) + i*sqrt(3)*K;
Psi(-1/4 + i*sqrt(3)/4) = 1 - J - log(2)/3 + (1/2)*Pi/cosh(Pi*sqrt(3)/2) + i*(sqrt(3) - sqrt(3)*K + Pi*tanh(Pi*sqrt(3)/2));
Psi(3/4 + i*sqrt(3)/4)= - J - i*sqrt(3)*k - log(2)/3 + (1/2)*Pi/cosh(Pi*sqrt(3)/4) + i*Pi*tanh(Pi*sqrt(3)/2).
Psi(-3/4 + i*sqrt(3)/4) = 1 - J - log(2)/3 - (1/2)*Pi/cosh(Pi*sqrt(3)/2) + i*(sqrt(3)/3 + sqrt(3)*K).
where Psi is the digamma function and i=sqrt(-1).

Examples

			1.27972874228189683364727570150763067226260...
		

Crossrefs

Cf. A054569 (terms), A339135.

Programs

  • Maple
    K:= Re(sum(1/(1+2*n+4*n^2), n=0..infinity)):
    evalf(K, 120);  # Alois P. Heinz, Dec 06 2020
  • Mathematica
    RealDigits[N[Re[Sum[1/(1 + 2*n + 4*n^2), {n, 0, Infinity}]], 110]][[1]]
  • PARI
    sumpos(n=0, 1/(1+2*n+4*n^2)) \\ Michel Marcus, Nov 28 2020

Formula

Equals -i/(2*sqrt(3)) * (Psi(1/4 + i*sqrt(3)/4) - Psi(1/4 - i*sqrt(3)/4)).
Equals Pi*sqrt(3)*tanh(Pi*sqrt(3)/2)/3 - Sum_{m>=0} 1/(3 + 6*m + 4*m^2).
Previous Showing 31-40 of 50 results. Next