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

A246435 Length of representation of n in fractional base 3/2.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 05 2014

Keywords

Crossrefs

Cf. A024629, A055642, A070989, A081604, A081848 (run lengths), A244040.

Programs

  • Haskell
    a246435 n = if n < 3 then 1 else a246435 (2 * div n 3) + 1
    -- Reinhard Zumkeller, Sep 05 2014
    
  • Mathematica
    a[n_] := If[n < 3, 1, a[2 Quotient[n, 3]] + 1]; Array[a, 100, 0] (* Jean-François Alcover, Feb 05 2019 *)
  • PARI
    a(n) = if(n < 3, 1, a(n\3 * 2) + 1); \\ Amiram Eldar, Jul 30 2025

Formula

a(n) = if n < 3 then 1, otherwise a(2*floor(n/3)) + 1.
a(n) = A055642(A024629(n)).

A076588 First occurrence of n as a term in the continued fraction for Pi/4.

Original entry on oeis.org

2, 8, 3, 76, 17, 67, 50, 54, 11, 20, 73, 413, 59, 162, 7, 75, 13, 587, 393, 24, 112, 228, 403, 40, 843, 560, 590, 69, 187, 617, 215, 400, 1182, 259, 1680, 548, 758, 226, 133, 78, 1265, 589, 96, 169, 3108, 5892, 258, 261, 4608, 3810, 2386, 1251, 2698, 2374
Offset: 1

Views

Author

Benoit Cloitre, Oct 20 2002

Keywords

Crossrefs

Programs

  • Mathematica
    With[{cf=ContinuedFraction[Pi/4,6000]},Table[Position[cf,n,1,1],{n,60}]]//Flatten (* Harvey P. Dale, Aug 25 2025 *)
  • PARI
    \\ 15000 precision digits
    v=contfrac(Pi/4); a(n)=if(n<0,0,s=1; while(abs(n-component(v,s))>0,s++); s)
Showing 1-2 of 2 results.