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

A087666 Consider recurrence b(0) = n/3, b(k+1) = b(k)*floor(b(k)); a(n) is the least k such that b(k) is an integer, or -1 if no integer is ever reached.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 27 2003

Keywords

Comments

It is conjectured that an integer is always reached if the initial value n/3 is >= 2.

Crossrefs

Cf. A083863 (integer reached), A086336 and A087663 (records), A057016, A087710, A088706 (inverse).

Programs

  • Maple
    # Gives right answer as long as answer is < M.
    # This is better than the Mathematica or PARI programs.
    M := 50; f := proc(n) local c,k,tn,tf; global M; k := n/3; c := 0; while whattype(k) <> 'integer' do tn := floor(k); tf := k-tn; tn := tn mod 3^50; k := tn*(tn+tf); c := c+1; od: c; end; # N. J. A. Sloane
  • Mathematica
    f[n_] := If[ Mod[3n, 3] == 0, 0, Length[ NestWhileList[ #1*Floor[ #1] &, n, !IntegerQ[ #2] &, 2]] - 1]; Table[f[n/3], {n, 6, 120}] (* Robert G. Wilson v *)
  • PARI
    a(n)=if(n<0,0,c=n/3; x=0; while(frac(c)>0,c=c*floor(c); x++); x) \\ Benoit Cloitre, Sep 29 2003
    
  • Python
    def A087666(n):
        c, x = 0, n
        a, b = divmod(x,3)
        while b != 0:
            x *= a
            c += 1
            a, b = divmod(x,3)
        return c # Chai Wah Wu, Mar 01 2021

Formula

a(n)=0 iff n == 0 (mod 3), a(n)==1 iff n == 1 or 2 (mod 3^2), a(n)=2 iff n == 14,22,25,26 (mod 3^3). In general a(n)=m iff n == x (mod 3^m) where x pertains to a set of 2^m distinct elements included in {1,2,...,(3^m)-1}. Conjecture: a(6) + a(7) + a(8) + ... + a(n) = 2n + O(sqrt(n)). - Benoit Cloitre, Sep 24 2012

Extensions

More terms from Benoit Cloitre, Sep 29 2003

A087663 Indices of records in A087666.

Original entry on oeis.org

6, 7, 8, 17, 40, 151, 877, 6835, 19687, 34502, 46375, 109057, 1315376, 1463921, 33422711, 117091367, 436282342, 542784031, 550371662, 5227148122, 55251647224
Offset: 1

Views

Author

N. J. A. Sloane, Sep 27 2003

Keywords

Crossrefs

Extensions

More terms from Robert G. Wilson v, Oct 10 2003
a(11) from N. J. A. Sloane, Oct 16 2003
a(12)-a(16) from Robert G. Wilson v, Mar 11 2004
a(17)-a(20) from Max Alekseyev, Jul 29 2011
a(21) from Chai Wah Wu, Mar 04 2021

A087710 Least k >= 6 such that A087666(k) = n.

Original entry on oeis.org

6, 10, 14, 7, 8, 31, 35, 17, 43, 40, 229, 248, 212, 818, 799, 733, 151, 2191, 1139, 20894, 877, 6835, 20528, 34627, 19687, 91790, 34502, 367558, 85336, 46375, 1342349, 134683, 109057, 2758327, 5921086, 1655564, 18147329, 11934733, 1315376, 1463921, 39945479
Offset: 0

Views

Author

Benoit Cloitre, Sep 30 2003

Keywords

Comments

A087666: Consider the recurrence b(0) = n/3, b(n) = b(n-1)*floor(b(n-1)); sequence gives number of steps to reach an integer, or -1 if no integer is ever reached. - Robert G. Wilson v, Oct 10 2003 & Mar 10 2004

Crossrefs

Programs

  • Maple
    See the Maple program in A087666 for the best way to compute this sequence. - N. J. A. Sloane
  • Mathematica
    f[n_] := Block[{c = 1, k = n/3}, If[ IntegerQ[k], 0, While[tn = Floor[k]; tf = k - tn; tn = Mod[tn, 3^100]; k = tn(tn + tf); ! IntegerQ[k], c++ ]; c++ ]]; a = Table[0, {50}]; Do[ b = f[n]; If[ a[[b + 1]] == 0, a[[b + 1]] = n; Print[b, " = ", n]], {n, 6, 10^7}]; a (* Robert G. Wilson v, Mar 10 2004, using the idea from N. J. A. Sloane's Maple code in A087666 *)

Extensions

More terms from Robert G. Wilson v, Oct 10 2003, Mar 10 2004

A083863 Consider recurrence b(0) = n/3, b(n) = b(n-1)*floor(b(n-1)); sequence gives first integer reached, or -1 if no integer is ever reached.

Original entry on oeis.org

2, 336, 480480, 3, 10, 11, 4, 86632, 336, 5, 480480, 602088585139494925392355287938913017768414449509198770325691172429632961571366883360109083120, 6, 38, 40, 7, 2618, 8089284, 8, 4400, 4784, 9, 84, 87, 10, 164651957685772369755334525952840, 267038744632379007295584790187520, 11, 3260628657396881107663076132351728
Offset: 6

Views

Author

N. J. A. Sloane, Sep 27 2003

Keywords

Comments

It is conjectured that an integer is always reached if the initial value is >= 2.

Crossrefs

Cf. A087666 (steps to reach an integer), A086336, A087663.

A192229 Indices of records in A087669.

Original entry on oeis.org

1, 2, 3, 5, 10, 11, 17, 23, 31, 47, 59, 71, 107, 151, 167, 239, 367, 421, 569, 587, 653, 701, 733, 857, 1063, 1229, 1693, 2003, 2141, 2273, 2531, 2549, 3181, 3547, 3919, 4703, 5437, 5659, 6379, 7841, 8093, 8209, 9001, 13313
Offset: 1

Views

Author

Max Alekseyev, Jun 26 2011

Keywords

Comments

Conjecture: the terms starting with 11 are prime.
Records are given by A192230.

Crossrefs

A192230 Records in A087669.

Original entry on oeis.org

0, 1, 3, 5, 9, 19, 27, 32, 78, 106, 108, 156, 367, 509, 542, 1155, 1158, 1172, 1262, 1268, 1428, 1738, 2497, 2868, 3989, 6018, 6452, 8010, 8178, 10537, 10870, 11434, 13915, 15370, 20685, 20852, 22854, 29415, 32406, 35779, 40456, 43938, 48568, 84406
Offset: 1

Views

Author

Max Alekseyev, Jun 26 2011

Keywords

Crossrefs

Formula

a(n) = A087669(A192229(n))
Showing 1-6 of 6 results.