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

A056107 Third spoke of a hexagonal spiral.

Original entry on oeis.org

1, 4, 13, 28, 49, 76, 109, 148, 193, 244, 301, 364, 433, 508, 589, 676, 769, 868, 973, 1084, 1201, 1324, 1453, 1588, 1729, 1876, 2029, 2188, 2353, 2524, 2701, 2884, 3073, 3268, 3469, 3676, 3889, 4108, 4333, 4564, 4801, 5044, 5293, 5548, 5809, 6076, 6349
Offset: 0

Views

Author

Henry Bottomley, Jun 09 2000

Keywords

Comments

a(n+1) is the number of lines crossing n cells of an n X n X n cube. - Lekraj Beedassy, Jul 29 2005
Equals binomial transform of [1, 3, 6, 0, 0, 0, ...]. - Gary W. Adamson, May 03 2008
Each term a(n), with n>1 represents the area of the right trapezoid with bases whose values are equal to hex number A003215(n) and A003215(n+1)and height equal to 1. The right trapezoid is formed by a rectangle with the sides equal to A003215(n) and 1 and a right triangle whose area is 3*n with the greater cathetus equal to the difference A003215(n+1)-A003215(n). - Giacomo Fecondo, Jun 11 2010
2*a(n)^2 is of the form x^4+y^4+(x+y)^4. In fact, 2*a(n)^2 = (n-1)^4+(n+1)^4+(2n)^4. - Bruno Berselli, Jul 16 2013
Numbers m such that m+(m-1)+(m-2) is a square. - César Aguilera, May 26 2015
After 4, twice each term belongs to A181123: 2*a(n) = (n+1)^3 - (n-1)^3. - Bruno Berselli, Mar 09 2016
This is a subsequence of A003136: a(n) = (n-1)^2 + (n-1)*(n+1) + (n+1)^2. - Bruno Berselli, Feb 08 2017
For n > 3, also the number of (not necessarily maximal) cliques in the n X n torus grid graph. - Eric W. Weisstein, Nov 30 2017

References

  • Edward J. Barbeau, Murray S. Klamkin and William O. J. Moser, Five Hundred Mathematical Challenges, MAA, Washington DC, 1995, Problem 444, pp. 42 and 195.
  • Ben Hamilton, Brainteasers and Mindbenders, Fireside, 1992, p. 107.

Crossrefs

Cf. A002648 (prime terms), A201053.
Other spirals: A054552.

Programs

Formula

a(n) = 3*n^2 + 1.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>2.
G.f.: (1+x+4*x^2)/(1-x)^3.
a(n) = a(n-1) + 6*n - 3 for n>0.
a(n) = 2*a(n-1) - a(n-2) + 6 for n>1.
a(n) = A056105(n) + 2*n = A056106(n) + n.
a(n) = A056108(n) - n = A056109(n) - 2*n = A003215(n) - 3*n.
a(n) = (A000578(n+1) - A000578(n-1))/2. - Lekraj Beedassy, Jul 29 2005
a(n) = A132111(n+1,n-1) for n>1. - Reinhard Zumkeller, Aug 10 2007
E.g.f.: (1 + 3*x + 3*x^2)*exp(x). - G. C. Greubel, Dec 02 2018
From Amiram Eldar, Jul 15 2020: (Start)
Sum_{n>=0} 1/a(n) = (1 + (Pi/sqrt(3))*coth(Pi/sqrt(3)))/2.
Sum_{n>=0} (-1)^n/a(n) = (1 + (Pi/sqrt(3))*csch(Pi/sqrt(3)))/2. (End)
From Amiram Eldar, Feb 05 2021: (Start)
Product_{n>=0} (1 + 1/a(n)) = sqrt(2)*csch(Pi/sqrt(3))*sinh(sqrt(2/3)*Pi).
Product_{n>=1} (1 - 1/a(n)) = (Pi/sqrt(3))*csch(Pi/sqrt(3)). (End)

A053187 Square nearest to n.

Original entry on oeis.org

0, 1, 1, 4, 4, 4, 4, 9, 9, 9, 9, 9, 9, 16, 16, 16, 16, 16, 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
Offset: 0

Views

Author

Henry Bottomley, Mar 01 2000

Keywords

Comments

Apart from 0, k^2 appears 2k times from a(k^2-k+1) through to a(k^2+k) inclusive.

Examples

			a(7) = 9 since 7 is closer to 9 than to 4.
G.f. = x + x^2 + 4*x^3 + 4*x^4 + 4*x^5 + 4*x^6 + 9*x^7 + 9*x^8 + 9*x^9 + ...
		

Crossrefs

Cf. A061023, A201053 (nearest cube), A000290, A000194.

Programs

  • Haskell
    a053187 n = a053187_list !! n
    a053187_list = 0 : concatMap (\x -> replicate (2*x) (x ^ 2)) [1..]
    -- Reinhard Zumkeller, Nov 28 2011
    
  • Maple
    seq(ceil((-1+sqrt(4*n+1))/2)^2, n=0..20); # Robert Israel, Jan 05 2015
  • Mathematica
    nearestSq[n_] := Block[{a = Floor@ Sqrt@ n}, If[a^2 + a + 1/2 > n, a^2, a^2 + 2 a + 1]]; Array[ nearestSq, 75, 0] (* Robert G. Wilson v, Aug 01 2014 *)
  • Python
    from math import isqrt
    def A053187(n): return ((m:=isqrt(n))+int(n>m*(m+1)))**2 # Chai Wah Wu, Jun 06 2025

Formula

a(n) = ceiling((-1 + sqrt(4*n+1))/2)^2. - Robert Israel, Aug 01 2014
G.f.: (1/(1-x))*Sum_{n>=0} (2*n+1)*x^(n^2+n+1). - Robert Israel, Aug 01 2014. This is related to the Jacobi theta-function theta'_1(q), see A002483 and A245552.
G.f.: x / (1-x) * Sum_{k>0} (2*k - 1) * x^(k^2 - k). - Michael Somos, Jan 05 2015
a(n) = floor(sqrt(n)+1/2)^2. - Mikael Aaltonen, Jan 17 2015
Sum_{n>=1} 1/a(n)^2 = 2*zeta(3). - Amiram Eldar, Aug 15 2022
a(n) = A000194(n)^2. - Chai Wah Wu, Jun 06 2025

Extensions

Title improved by Jon E. Schoenfield, Jun 09 2019

A048762 Largest cube <= n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 64, 64, 64
Offset: 0

Views

Author

Charles T. Le (charlestle(AT)yahoo.com)

Keywords

References

  • Krassimir T. Atanassov, On the 40th and 41st Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 4, No. 3 (1998), 101-104.
  • J. Castillo, Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x, Smarandache Notions Journal, Vol. 10, No. 1-2-3 (1999), 202-204.

Crossrefs

Programs

  • Haskell
    a048762 n = last $ takeWhile (<= n) a000578_list
    -- Reinhard Zumkeller, Nov 28 2011
  • Maple
    A048762 := proc(n)
            floor(root[3](n)) ;
            %^3 ;
    end proc: # R. J. Mathar, Nov 06 2011
  • Mathematica
    Floor[Surd[Range[0,70],3]]^3 (* Harvey P. Dale, Jun 23 2013 *)

Formula

Sum_{n>=1} 1/a(n)^2 = Pi^4/30 + Pi^6/945 + 3*zeta(5). - Amiram Eldar, Aug 15 2022

A074989 Distance from n to nearest cube.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Oct 02 2002

Keywords

Comments

a(n)=0 when n is a cube; between zeros local maxima are of form 3/2 k(k-1).

Examples

			a(3) = 2 because the nearest cube to 3 is 1 and distance from 3 to 1 is 2.
		

Crossrefs

Cf. A053188 (distance from n to nearest square).

Programs

  • Haskell
    a074989 0 = 0
    a074989 n = min (n - last xs) (head ys - n) where
       (xs,ys) = span (< n) a000578_list
    -- Reinhard Zumkeller, Nov 28 2011
    
  • Maple
    A074989 := proc(n) local iscbr ; iroot(n,3,'iscbr') ; if iscbr then 0; else iscbr := floor(n^(1/3)) ; min((iscbr+1)^3-n, n-iscbr^3) ; end if; end proc; # R. J. Mathar, Nov 01 2009
  • Mathematica
    dnc[n_]:=Module[{cr=Surd[n,3]},Min[n-Floor[cr]^3,Ceiling[cr]^3-n]]; Array[ dnc,90,0] (* Harvey P. Dale, Jan 24 2015 *)
  • Python
    from sympy import integer_nthroot
    def A074989(n):
        a = integer_nthroot(n,3)[0]
        return min(n-a**3,(a+1)**3-n) # Chai Wah Wu, Mar 31 2021

Extensions

a(0) added and offset changed by Reinhard Zumkeller, Nov 28 2011

A048763 Smallest cube >= n.

Original entry on oeis.org

0, 1, 8, 8, 8, 8, 8, 8, 8, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 125, 125, 125, 125, 125, 125
Offset: 0

Views

Author

Charles T. Le (charlestle(AT)yahoo.com)

Keywords

References

  • Krassimir T. Atanassov, On the 40th and 41st Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 4, No. 3 (1998), 101-104.
  • J. Castillo, Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x, Smarandache Notions Journal, Vol. 10, No. 1-2-3 (1999), 202-204.

Crossrefs

Programs

  • Haskell
    a048763 0 = 0
    a048763 n = head $ dropWhile (< n) a000578_list
    -- Reinhard Zumkeller, Nov 28 2011
  • Maple
    A048763 := proc(n)
            ceil(root[3](n)) ;
            %^3 ;
    end proc: # R. J. Mathar, Nov 06 2011
  • Mathematica
    With[{nn=80},Flatten[Table[Select[Range[0,Floor[nn^(1/3)]+1]^3,#>=n&,1],{n,0,nn}]]] (* Harvey P. Dale, Aug 09 2012 *)

Formula

Sum_{n>=1} 1/a(n)^2 = Pi^4/30 + Pi^6/945 - 3*zeta(5). - Amiram Eldar, Aug 15 2022

Extensions

a(65), a(66) and a(67) corrected by Reinhard Zumkeller, Nov 28 2011

A061023 Difference between the closest square and the closest cube to n.

Original entry on oeis.org

0, 0, 0, 3, 3, 4, 4, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 11, 11, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 22, 22, 22, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17
Offset: 0

Views

Author

Hareendra Yalamanchili (hyalaman(AT)mit.edu), May 24 2001

Keywords

Comments

a(A201217(n)) = 0.

Examples

			a(46)=15 because the nearest square is 49 and the nearest cube is 64 and 64 - 49 = 15.
		

Crossrefs

Programs

  • Haskell
    a061023 n = abs (a053187 n - a201053 n)
    a061023_list = map a061023 [0..]
    -- Reinhard Zumkeller, Nov 28 2011
  • Mathematica
    dsc[n_]:=Module[{s=Floor[Sqrt[n]],c=Floor[Power[n, (3)^-1]],ns,nc}, ns= Nearest[{s^2,(s+1)^2},n]; nc=Nearest[{c^3,(c+1)^3},n];Abs[nc-ns]]; Flatten[ Array[dsc,100,0]] (* Harvey P. Dale, Aug 19 2011 *)
  • PARI
    { for (n=0, 10000, x=n^(1/2); s=floor(x)^2; t=ceil(x)^2; if (n-s > t-n, s=t); x=n^(1/3); c=floor(x)^3; d=ceil(x)^3; if (n-c > d-n, c=d); write("b061023.txt", n, " ", abs(c-s)) ) } \\ Harry J. Smith, Jul 16 2009
    

Formula

a(n) = abs(A053187(n) - A201053(n)). [Reinhard Zumkeller, Nov 28 2011]

Extensions

More terms from Harvey P. Dale, Aug 19 2011

A201217 Numbers such that (closest square) = (closest cube).

Original entry on oeis.org

0, 1, 2, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 28 2011

Keywords

Comments

A061023(a(n)) = 0; A053187(a(n)) = A201053(a(n));
A001014 is a subsequence (6th powers).

Programs

  • Haskell
    import Data.List (elemIndices)
    a201217 n = a201217_list !! (n-1)
    a201217_list = elemIndices 0 a061023_list
    -- Reinhard Zumkeller, Nov 28 2011

A342872 Distance to nearest product of 3 consecutive numbers (three-dimensional promic number, A007531).

Original entry on oeis.org

0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
Offset: 0

Views

Author

Lamine Ngom, Mar 28 2021

Keywords

Examples

			a(13) = 7 since 6 is the closest three-dimensional promic to 13 and 13 - 6 = 7.
		

Crossrefs

Other distance to nearest: A081134, A053646, A201053.

Programs

  • Python
    def a(n): return min(abs(n-k*(k+1)*(k+2)) for k in range(int(n**1/3)+1))
    print([a(n) for n in range(78)]) # Michael S. Branicky, Mar 28 2021

A342873 Numbers whose distance to the nearest cube equals the distance to the nearest product of 3 consecutive integers (three-dimensional oblong).

Original entry on oeis.org

0, 7, 16, 62, 92, 213, 276, 508, 616, 995, 1160, 1722, 1956, 2737, 3052, 4088, 4496, 5823, 6336, 7990, 8620, 10637, 11396, 13812, 14712, 17563, 18616, 21938, 23156, 26985, 28380, 32752, 34336, 39287, 41072, 46638, 48636, 54853, 57076, 63980, 66440, 74067
Offset: 1

Views

Author

Lamine Ngom, Mar 28 2021

Keywords

Comments

That is, numbers k such that A074989(k) = A342872(k).
They form 2 partitions:
7, 62, 213, ... = 8*k^3 - k = k*A157914(k).
0, 16, 92, ... = 8*k^3 + 6*k^2 + 2*k = 2*k*A033951(k).

Crossrefs

Programs

  • Python
    def aupto(limit):
      cubes = [k**3 for k in range(int((limit+1)**1/3)+2)]
      proms = [k*(k+1)*(k+2) for k in range(int((limit+1)**1/3)+1)]
      A074989 = [min(abs(n-c) for c in cubes) for n in range(limit+1)]
      A342872 = [min(abs(n-p) for p in proms) for n in range(limit+1)]
      return [m for m in range(limit+1) if A074989[m] == A342872[m]]
    print(aupto(10**4)) # Michael S. Branicky, Mar 28 2021
Showing 1-9 of 9 results.