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.

A369861 The orbit of n under iterations of x -> concatenate(A048762(x), A055400(x)) enters a pseudo-loop x(k) = a^3 * 10^((k-k0)*A055642(b)) + b for k > k0. This sequence lists the b-value.

Original entry on oeis.org

586, 587, 588, 589, 590, 591, 592, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 748673, 748674, 748675, 748676, 748677, 748678, 748679, 748680, 748681, 709030, 709031, 709032, 709033, 709034, 709035, 709036, 709037, 709038, 709039, 513, 514, 515, 516, 517, 518, 519, 520
Offset: 1

Views

Author

M. F. Hasler, Apr 03 2024

Keywords

Comments

The iterated function can also be defined as x -> c(x)*(10^L(x-c(x))-1) + x, where c(x) = A048762(x) = floor(x^(1/3))^3 is the largest perfect cube <= x; A055400(x) = x-c(x) is the "cube excess" of x, and L(x) = A055642(x) = floor(log_10(max(x,1))+1) is the number of decimal digits of x.
Often a(n+1) = a(n) + 1, especially when c(n+1) = c(n), in which case it is probable that all elements of the orbit of n+1 are just one larger than the elements of the orbit of n.

Examples

			Starting with 1, we get 1 -> 10 -> 82 (since 8 is the largest cube <= 10, at distance 2) -> 6418 (since the cube 64 is at distance 18) -> 5832586 (since 5832 = 18^3 is at distance 586) -> 5832000586 (since 180^3 is again at distance 586) -> ...: Each time 3 '0's will be inserted in front of the remainder which remains always the same, a(1) = 586, as does the cube root up to an additional factor of 10.
Starting with 2, we get 2 -> 11 (since the largest cube <= 2 is 1, at distance 1) -> 83 (since largest cube <= 11 is 8, at distance 2) -> 6419(since the cube 64 is at distance 19) -> 5832587 (since 5832 = 18^3 is at distance 587) -> 5832000587 (since 180^3 is again at distance 587) -> ... We see that in this sequence each term is one more than that of the preceding sequence, whence also a(2) = 587 = a(1)+1.
Starting with 8, we get 8 -> 80 (since the largest cube <= 8 is 8, at distance 0) -> 6416 (since the cube 64 is at distance 16, two less than in 1's orbit) -> 5832584 (since 5832 = 18^3 is at distance 584, again 2 less than in 1's orbit) -> 5832000584 (since 180^3 is again at distance 584) -> ... We see that in this sequence each term is 2 (resp. 8) less than the corresponding term of 1's (resp. 7's) orbit (with the initial term deleted). Hence also a(8) = 584 = a(7)-8 = a(1)-2. From here on subsequent terms will again increase by 1 up to n = 17.
Starting with 18, we get 18 -> 810 (since the largest cube <= 18 is 8, at distance 10) -> 72981 (since the cube 729 is at distance 81) -> 689214060 (since 68921 = 41^3 is at distance 4060) -> 688465387748673 (since 688465387 = 883^3 is at distance 748673), from where on the cube roots get multiplied by 10 and the distance from the cubes remains the same, a(18) = 748673.
For n = 64 -> 640 (= 8^3 + 128) -> 512128 = 80^3 + 128, we have a(n) = 128.
		

Crossrefs

Cf. A000578 (cubes), A048766 (cube root), A048762 (largest cube <= n), A055400 (cube excess), A055642 (length of n in base 10), A122840 (10-valuation of n).
Cf. A369860 (a-values)

Programs

  • PARI
    A369861(n)={until(, my(c=sqrtnint(n,3), v=valuation(c,10), L=logint(max(n-c^3,1),10)+1); L==v*3 && return(n-c^3); n += c^3*(10^L-1))}
    
  • Python
    import sympy
    def A369861(n: int):
        while True:
            C = sympy.integer_nthroot(n, 3)[0]**3; L = A055642(n-C)
            if sympy.multiplicity(10, C) == L: return n-C
            n += C * (10**L - 1)

A055401 Number of positive cubes needed to sum to n using the greedy algorithm.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, May 16 2000

Keywords

Comments

Define f(n) = n - k^3 where (k+1)^3 > n >= k^3; a(n) = number of steps such that f(f(...f(n)))= 0.
Also sum of digits when writing n in base where place values are positive cubes, cf. A000433. [Reinhard Zumkeller, May 08 2011]

Examples

			a(32)=6 because 32=27+1+1+1+1+1 (not 32=8+8+8+8).
a(33)=7 because 33=27+1+1+1+1+1+1 (not 33=8+8+8+8+1).
		

Crossrefs

Cf. A002376 (least number of positive cubes needed to represent n; differs from this sequence for the first time at n=32, where a(32)=6, while A002376(32)=4).

Programs

  • Haskell
    a055401 n = s n $ reverse $ takeWhile (<= n) $ tail a000578_list where
      s _ []                 = 0
      s m (x:xs) | x > m     = s m xs
                 | otherwise = m' + s r xs where (m',r) = divMod m x
    -- Reinhard Zumkeller, May 08 2011
    (Scheme, with memoization-macro definec)
    (definec (A055401 n) (if (zero? n) n (+ 1 (A055401 (A055400 n)))))
    ;; Antti Karttunen, Aug 16 2015
  • Maple
    f:= proc(n,k) local m, j;
    if n = 0 then return 0 fi;
    for j from k by -1 while j^3 > n do od:
    m:= floor(n/j^3);
    m + procname(n-m*j^3, j-1);
    end proc:
    seq(f(n,floor(n^(1/3))),n=0..100); # Robert Israel, Aug 17 2015
  • Mathematica
    a[0] = 0; a[n_] := {n} //. {b___, c_ /; !IntegerQ[c^(1/3)], d___} :> {b, f = Floor[c^(1/3)]^3, c - f, d} // Length; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Aug 17 2015 *)
  • PARI
    F=vector(30,n,n^3); /* modify to get other sequences of "greedy representations" */ last_leq(v,F)=
    { /* Return last element <=v in sorted array F[] */
        local(j=1);
        while ( F[j]<=v, j+=1 );
        return( F[j-1] );
    }
    greedy(n,F)=
    {
        local(v=n,ct=0);
        while ( v,  v-=last_leq(v,F); ct+=1; );
        return(ct);
    }
    vector(min(100,F[#F-1]),n,greedy(n,F)) /* show terms */
    /* Joerg Arndt, Apr 08 2011 */
    

Formula

a(0) = 0; for n >= 1, a(n) = a(n-floor(n^(1/3))^3)+1 = a(A055400(n))+1 = a(n-A048762(n))+1.

Extensions

a(0) = 0 prepended by Antti Karttunen, Aug 16 2015

A055400 Cube excess: difference between n and largest cube <= n.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 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, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
Offset: 0

Views

Author

Henry Bottomley, May 16 2000

Keywords

Examples

			a(12) = 4 because 2^3 <= 12 < 3^3 and 12 - 2^3 = 4.
		

Crossrefs

Programs

Formula

a(n) = n - A048762(n) = n - floor(n^(1/3))^3.
a(n) < 3*n^(2/3) for n > 0. - Charles R Greathouse IV, Sep 02 2015

A201053 Nearest cube.

Original entry on oeis.org

0, 1, 1, 1, 1, 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, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 28 2011

Keywords

Comments

a(n) = if n-A048763(n) < A048762(n)-n then A048762(n) else A048763(n);
apart from 0, k^3 occurs 3*n^2+1 times, cf. A056107.

Crossrefs

Cf. A061023, A074989, A053187 (nearest square), A000578.

Programs

  • Haskell
    a201053 n = a201053_list !! n
    a201053_list = 0 : concatMap (\x -> replicate (a056107 x) (x ^ 3)) [1..]
    
  • Maple
    seq(k^3 $ (3*k^2+1), k=0..10); # Robert Israel, Jan 03 2017
  • Mathematica
    Module[{nn=70,c},c=Range[0,Ceiling[Surd[nn,3]]]^3;Flatten[Array[ Nearest[ c,#]&,nn,0]]] (* Harvey P. Dale, May 27 2014 *)
  • Python
    from sympy import integer_nthroot
    def A201053(n):
        a = integer_nthroot(n,3)[0]
        return a**3 if 2*n < a**3+(a+1)**3 else (a+1)**3 # Chai Wah Wu, Mar 31 2021

Formula

G.f.: (1-x)^(-1)*Sum_{k>=0} (3*k^2+3*k+1)*x^((k+1)*(k^2+k/2+1)). - Robert Israel, Jan 03 2017
Sum_{n>=1} 1/a(n)^2 = Pi^4/30 + Pi^6/945. - Amiram Eldar, Aug 15 2022

A261225 n minus the number of positive cubes needed to sum to n using the greedy algorithm: a(n) = n - A055401(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 26, 26, 26, 26, 26, 26, 26, 26, 33, 33, 33, 33, 33, 33, 33, 33, 40, 40, 40, 40, 40, 40, 40, 40, 47, 47, 47, 52, 52, 52, 52, 52, 52, 52, 52, 59, 59, 63, 63, 63, 63, 63, 63, 63, 63, 70, 70, 70, 70, 70, 70, 70, 70, 77, 77, 77, 77, 77, 77, 77, 77, 84, 84, 84, 89
Offset: 0

Views

Author

Antti Karttunen, Aug 16 2015

Keywords

Examples

			a(8) = 7, because when the greedy algorithm partitions 8 into cubes, it first finds 8 (= 2*2*2), thus A055401(8) = 1, and 8-1 = 7.
		

Crossrefs

Formula

a(n) = n - A055401(n).
As a recurrence:
a(0) = 0; for n >= 1, a(n) = -1 + A048762(n) + a(n-A048762(n)). [Where A048762(n) gives the largest cube <= n.]

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

A369860 The orbit of n under iterations of x -> c(x)*10^L(x-c(x)) + x-c(x), where c(x) = floor(x^(1/3))^3, L(x) = floor(log_10(max(x,1))+1), enters a pseudo-loop x(k) = a^3 * 10^((k-k0)*L(b)) + b beyond some k0. This sequence lists the a-values.

Original entry on oeis.org

18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 883, 883, 883, 883, 883, 883, 883, 883, 883, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8
Offset: 1

Views

Author

M. F. Hasler, Apr 05 2024

Keywords

Comments

The iterated function can also be defined as x -> concatenate(c(x), x-c(x)), where c = A048762 gives the largest perfect cube <= x and x - c(x) = A055400(x) is the "cube excess" of x. L = A055642 gives the number of decimal digits.
The corresponding b-values are listed in A369861.

Examples

			Starting with 1, we get 1 -> 10 -> 82 (since 8 is the largest cube <= 10, at distance 2) -> 6418 (since the cube 64 is at distance 18) -> 5832586 (since 5832 = 18^3 is at distance 586) -> 5832000586 (since 180^3 is again at distance 586) -> ...: Each time 3 '0's will be inserted in front of the remainder which remains always the same, as does the cube root a(1) = 18, up to factors of 10.
Starting with 2, we get 2 -> 11 (since the largest cube <= 2 is 1, at distance 1) -> 83 (since largest cube <= 11 is 8, at distance 2) -> 6419 (since the cube 64 is at distance 19) -> 5832587 (since 5832 = 18^3 is at distance 587). We see that in this sequence each term is just one more than that of the preceding sequence, so the cube root remains the same, a(2) = a(1) = 18.
For n = 18, we get 18 -> 810 (since the largest cube <= 18 is 8, at distance 10) -> 72981 (since the cube 729 is at distance 81) -> 689214060 (since 68921 = 41^3 is at distance 4060) -> 688465387748673 (since 688465387 = 883^3 is at distance 748673), from where on the cube root a(18) = 883 gets an additional factor 10 at each step, but the cube excess A055400 remains the same, A369861(18) = 748673.
See A369861 for more examples.
		

Crossrefs

Cf. A000578 (cubes), A048766 (cube root), A048762 (largest cube <= n), A055400 (cube excess), A055642 (length of n in base 10), A122840 (10-valuation of n).
Cf. A369861 (b-values).

Programs

  • PARI
    A369860(n)={until(, my(c=sqrtnint(n, 3), v=valuation(c, 10), L=logint(max(n-c^3, 1), 10)+1); L==v*3 && return(c/10^v); n += c^3*(10^L-1))}
    
  • Python
    import sympy # for integer_nthroot (A048766), multiplicity (A122840)
    def A369860(n: int):
        while True:
            C = sympy.integer_nthroot(n, 3)[0]; L = A055642(n-C**3)
            if sympy.multiplicity(10, C)*3 == L: return C//10**(L//3)
            n += C**3 * (10**L - 1)

A163849 Primes p such that the difference between the nearest cubes above and below p is prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 733, 739, 743, 751, 757, 761, 769, 773
Offset: 1

Views

Author

Keywords

Comments

There is a sequence A048763(A000040(n)) = A145446(n) of nearest cubes above the primes and a sequence A048762(A000040(n)) of nearest cubes below the primes.
If the difference A145446(n) - A048762(A000040(n)) is prime, then A000040(n) is in this sequence.

Examples

			The difference of cubes 6^3 - 5^3 = 91 = 7*13 is not prime, so the primes larger than 5^3 = 125 but smaller than 6^3 = 216 are not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=IntegerPart[n^(1/3)]; lst={};Do[p=Prime[n];If[PrimeQ[(f[p]+1)^3-f[p]^3], AppendTo[lst,p]],{n,6!}];lst

Extensions

Edited by R. J. Mathar, Aug 12 2009

A163850 Primes p such that their distance to the nearest cube above p and also their distance to the nearest cube below p are prime.

Original entry on oeis.org

3, 127, 24391, 29789, 328511, 2460373, 3048623, 9393929, 10503461
Offset: 1

Views

Author

Keywords

Comments

The two sequences A048763(p) and A048762(p), p=A000040(n), define
nearest cubes above and below each prime p. If p is in A146318, the
distance to the larger cube, A048763(p)-p, is prime. If p is
in the set {3, 11, 13, 19, 29, 67,...,107, 127, 223,..}, the distance to the lower
cube is prime. If both of these distances are prime, we insert p into the sequence.

Examples

			p=3 is in the sequence because the distance p-1=2 to the cube 1^3 below 3, and also the distance 8-p=5 to the cube 8=2^3 above p are prime.
p=127 is in the sequence because the distance p-125=2 to the cube 125=5^3 below p, and also the distance 216-p=89 to the cube 216=6^3 above p, are prime.
		

Crossrefs

Programs

  • Mathematica
    Clear[f,lst,p,n]; f[n_]:=IntegerPart[n^(1/3)]; lst={};Do[p=Prime[n];If[PrimeQ[p-f[p]^3]&&PrimeQ[(f[p]+1)^3-p],AppendTo[lst,p]],{n,9!}];lst
    dncQ[n_]:=Module[{c=Floor[Surd[n,3]]},AllTrue[{n-c^3,(c+1)^3-n},PrimeQ]]; Select[Prime[Range[230000]],dncQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 16 2016 *)

Extensions

Edited, first 5 entries checked by R. J. Mathar, Aug 12 2009
Two more terms (a(8) and a(9)) from Harvey P. Dale, Oct 16 2016
Showing 1-9 of 9 results.