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-10 of 259 results. Next

A002251 Start with the nonnegative integers; then swap L(k) and U(k) for all k >= 1, where L = A000201, U = A001950 (lower and upper Wythoff sequences).

Original entry on oeis.org

0, 2, 1, 5, 7, 3, 10, 4, 13, 15, 6, 18, 20, 8, 23, 9, 26, 28, 11, 31, 12, 34, 36, 14, 39, 41, 16, 44, 17, 47, 49, 19, 52, 54, 21, 57, 22, 60, 62, 24, 65, 25, 68, 70, 27, 73, 75, 29, 78, 30, 81, 83, 32, 86, 33, 89, 91, 35, 94, 96, 37, 99, 38, 102, 104, 40, 107, 109
Offset: 0

Views

Author

Keywords

Comments

(n,a(n)) are Wythoff pairs: (0,0), (1,2), (3,5), (4,7), ..., where each difference occurs once.
Self-inverse when considered as a permutation or function, i.e., a(a(n)) = n. - Howard A. Landman, Sep 25 2001
If the offset is 1, the sequence can also be obtained by rearranging the natural numbers so that sum of n terms is a multiple of n, or equivalently so that the arithmetic mean of the first n terms is an integer. - Amarnath Murthy, Aug 16 2002
For n = 1, 2, 3, ..., let p(n)=least natural number not already an a(k), q(n) = n + p(n); then a(p(n)) = q(n), a(q(n)) = p(n). - Clark Kimberling
Also, indices of powers of 2 in A086482. - Amarnath Murthy, Jul 26 2003
There is a 7-state Fibonacci automaton (see a002251_1.pdf) that accepts, in parallel, the Zeckendorf representations of n and a(n). - Jeffrey Shallit, Jul 14 2023

References

  • E. R. Berlekamp, J. H. Conway and R. K. Guy, Winning Ways, Academic Press, NY, 2 vols., 1982, see p. 76.

Crossrefs

The sequence maps between A000201 and A001950, in that a(A000201(n)) = A001950(n), a(A001950(n)) = A000201(n).
Row 0 of A018219.

Programs

  • Mathematica
    With[{n = 42}, {0}~Join~Take[Values@ #, LengthWhile[#, # == 1 &] &@ Differences@ Keys@ #] &@ Sort@ Flatten@ Map[{#1 -> #2, #2 -> #1} & @@ # &, Transpose@ {Array[Floor[# GoldenRatio] &, n], Array[Floor[# GoldenRatio^2] &, n]}]] (* Michael De Vlieger, Nov 14 2017 *)
  • PARI
    A002251_upto(N,c=0,A=Vec(0,N))={for(n=1,N, A[n]||(#AA002251[1]=2, a(0)=0 is not included. - M. F. Hasler, Nov 27 2019, replacing earlier code from Sep 17 2014

Formula

a(n) = A019444(n+1) - 1.

Extensions

Edited by Christian G. Bower, Oct 29 2002

A024325 a(n) = s(1)*t(n) + s(2)*t(n-1) + ... + s(k)*t(n+1-k), where k = floor((n+1)/2), s = A023531, t = A001950 (upper Wythoff sequence).

Original entry on oeis.org

0, 0, 5, 7, 10, 13, 15, 18, 33, 38, 44, 48, 54, 60, 64, 70, 98, 106, 114, 121, 130, 137, 145, 153, 160, 169, 213, 223, 233, 244, 255, 265, 275, 286, 297, 307, 317, 328, 391, 403, 416, 430, 442, 456, 469, 481, 496, 508, 521, 534, 547, 561, 644, 659, 675, 690, 707, 722, 737, 755
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    A023531:= func< n | IsIntegral( (Sqrt(8*n+9) -3)/2 ) select 1 else 0 >;
    A024325:= func< n | (&+[A023531(j)*Floor((n-j+1)*(3+Sqrt(5))/2): j in [1..Floor((n+1)/2)]]) >;
    [A024325(n) : n in [1..80]]; // G. C. Greubel, Jan 28 2022
    
  • Mathematica
    A023531[n_] := SquaresR[1, 8n+9]/2;
    a[n_]:= a[n]= Sum[A023531[j]*Floor[(n-j+1)*GoldenRatio^2], {j,Floor[(n+1)/2]}];
    Table[a[n], {n, 80}] (* G. C. Greubel, Jan 28 2022 *)
  • Sage
    def A023531(n):
        if ((sqrt(8*n+9) -3)/2).is_integer(): return 1
        else: return 0
    def A023325(n): return sum( A023531(j)*floor(((n-j+1)*(3+sqrt(5)))/2) for j in (1..((n+1)//2)) )
    [A023325(n) for n in (1..80)] # G. C. Greubel, Jan 28 2022

Formula

a(n) = Sum_{j=1..floor((n+1)/2)} A023531(j)*A001950(n-j+1).

A003234 Numbers k such that A003231(A001950(k)) = A001950(A003231(k)) - 1.

Original entry on oeis.org

3, 8, 11, 16, 19, 21, 24, 29, 32, 37, 42, 45, 50, 53, 55, 58, 63, 66, 71, 74, 76, 79, 84, 87, 92, 97, 100, 105, 108, 110, 113, 118, 121, 126, 129, 131, 134, 139, 142, 144, 147, 152, 155, 160, 163, 165, 168, 173, 176, 181, 186, 189, 194, 197, 199, 202, 207
Offset: 1

Views

Author

Keywords

Comments

See 3.3 p. 344 in Carlitz link. - Michel Marcus, Feb 02 2014
This is the function named s in [Carlitz]. - Eric M. Schmidt, Aug 14 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a003234 n = a003234_list !! (n-1)
    a003234_list = [x | x <- [1..],
                        a003231 (a001950 x) == a001950 (a003231 x) - 1]
    -- Reinhard Zumkeller, Oct 03 2014
    
  • Maple
    A003234 := proc(n)
        option remember;
        if n =1 then
            3;
        else
            for a from procname(n-1)+1 do
                if A003231(A001950(a)) = A001950(A003231(a))-1 then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A003234(n),n=1..80) ; # R. J. Mathar, Jul 16 2024
  • Mathematica
    a3[n_] := Floor[n (Sqrt[5] + 3)/2];
    a5[n_] := Floor[n (Sqrt[5] + 5)/2];
    Select[Range[300], a5[a3[#]] == a3[a5[#]]-1&] (* Jean-François Alcover, Jul 31 2018 *)
  • PARI
    A001950(n) = floor(n*(sqrt(5)+3)/2);
    A003231(n) = floor(n*(sqrt(5)+5)/2);
    isok(n) = A003231(A001950(n)) == A001950(A003231(n)) - 1; \\ Michel Marcus, Feb 02 2014
    
  • Python
    from math import isqrt
    from itertools import count, islice
    def A003234_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:((m:=(n+isqrt(5*n**2)>>1)+n)+isqrt(5*m**2)>>1)+(m<<1)+1==((k:=(n+isqrt(5*n**2)>>1)+(n<<1))+isqrt(5*k**2)>>1)+k,count(max(1,startvalue)))
    A003234_list = list(islice(A003234_gen(),30)) # Chai Wah Wu, Sep 02 2022

Extensions

More terms from Michel Marcus, Feb 02 2014
Definition from Michel Marcus moved from comment to name by Eric M. Schmidt, Aug 17 2014

A026242 a(n) = j if n is L(j), else a(n) = k if n is U(k), where L = A000201, U = A001950 (lower and upper Wythoff sequences).

Original entry on oeis.org

1, 1, 2, 3, 2, 4, 3, 5, 6, 4, 7, 8, 5, 9, 6, 10, 11, 7, 12, 8, 13, 14, 9, 15, 16, 10, 17, 11, 18, 19, 12, 20, 21, 13, 22, 14, 23, 24, 15, 25, 16, 26, 27, 17, 28, 29, 18, 30, 19, 31, 32, 20, 33, 21, 34, 35, 22, 36, 37, 23, 38, 24, 39, 40, 25, 41
Offset: 1

Views

Author

Keywords

Comments

Every positive integer occurs exactly twice. a(n) is the parent of n in the tree at A074049. - Clark Kimberling, Dec 24 2010
Apparently, if n=F(m) (a Fibonacci number), one of two circumstances arise:
I. a(n)=F(m-1) and a(n-1)=F(m-2). When this happens, a(n) occurs for the first time and a(n-1) occurs for the second time;
II. a(n)=F(m-2) and a(n-1)=F(m-1). When this happens, a(n) occurs for the second time and a(n-1) occurs for the first time. - Bob Selcoe, Sep 18 2014
These are the numerators when all fractions, j/r and k/r^2, are arranged in increasing order (where r = golden ratio and j,k are positive integers). - Clark Kimberling, Mar 02 2015

Crossrefs

Cf. A000045 (Fibonacci numbers).

Programs

  • Mathematica
    mx = 100; gr = GoldenRatio; LW[n_] := Floor[n*gr]; UW[n_] := Floor[n*gr^2]; alw = Array[LW, Ceiling[mx/gr]]; auw = Array[UW, Ceiling[mx/gr^2]]; f[n_] := If[ MemberQ[alw, n], Position[alw, n][[1, 1]], Position[auw, n][[1, 1]]]; Array[f, mx] (* Robert G. Wilson v, Sep 17 2014 *)
  • PARI
    my(A=vector(10^4),i,j=0); while(#A>=i=A000201(j++), A[i]=j; (i=A001950(j))>#A || A[i]=j); A026242=A \\ M. F. Hasler, Sep 16 2014 and Sep 18 2014
    
  • PARI
    A026242=vector(#A002251,n,abs(A002251[n]-n)) \\ M. F. Hasler, Sep 17 2014

Formula

a(n) = a(m) if a(m) has already occurred exactly once and n = a(m) + m; otherwise, a(n) = least positive integer that has not yet occurred.
a(n) = abs(A002251(n) - n).
n = a(n) + a(n-1) unless n = A089910(m); if n = A089910(m), then n = a(n) + a(n-1) - m. - Bob Selcoe, Sep 20 2014
There is a 17-state automaton that accepts the Zeckendorf (Fibonacci) representation of n and a(n), in parallel. See the file a026242.pdf. - Jeffrey Shallit, Dec 21 2023

A282162 Difference sequence of the upper Wythoff sequence, A001950, with 2 prepended.

Original entry on oeis.org

2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 3
Offset: 0

Views

Author

Clark Kimberling, Feb 09 2017

Keywords

Comments

Another version of the infinite Fibonacci word (see Formula). Start with 2, apply 2->23, 3->233, and take the limit.

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio^2; Table[Floor[(n + 1) r] - Floor[n r], {n, 0, 120}]
  • Python
    from math import isqrt
    def A282162(n): return (n+3+isqrt(m:=5*(n+1)**2)>>1)-(n+isqrt(m-10*n-5)>>1) # Chai Wah Wu, May 05 2025

Formula

a(n) = 1 + A001468(n).

A003249 a(n) = A001950(A003234(n)) + 1.

Original entry on oeis.org

8, 21, 29, 42, 50, 55, 63, 76, 84, 97, 110, 118, 131, 139, 144, 152, 165, 173, 186, 194, 199, 207, 220, 228, 241, 254, 262, 275, 283, 288, 296, 309, 317, 330, 338, 343, 351, 364, 372, 377, 385, 398, 406, 419, 427, 432, 440, 453, 461, 474, 487, 495, 508, 516
Offset: 1

Views

Author

Keywords

Comments

This is the function named u' in [Carlitz]. - Eric M. Schmidt, Aug 14 2014

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A242094 (complement), A001950, A003234.

Programs

Extensions

Corrected and extended by, and a definition from Eric M. Schmidt, Aug 14 2014

A259556 Rectangular array, read by antidiagonals: T(h,k) = u(h) + v(k), where u = A000201 (lower Wythoff numbers), v = A001950 (upper Wythoff numbers), and h >= 1, k >= 1.

Original entry on oeis.org

3, 6, 5, 8, 8, 6, 11, 10, 9, 8, 14, 13, 11, 11, 10, 16, 16, 14, 13, 13, 11, 19, 18, 17, 16, 15, 14, 13, 21, 21, 19, 19, 18, 16, 16, 14, 24, 23, 22, 21, 21, 19, 18, 17, 16, 27, 26, 24, 24, 23, 22, 21, 19, 19, 18, 29, 29, 27, 26, 26, 24, 24, 22, 21, 21, 19, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21
Offset: 1

Views

Author

Clark Kimberling, Jul 22 2015

Keywords

Examples

			Northwest corner:
3    6    8    11   14   16   19
5    8    10   13   16   18   21
6    9    11   14   17   19   22
8    11   13   16   19   22   24
10   13   15   18   21   23   26
11   14   16   19   22   24   27
T(2,3) = u(2) + v(3) = 3 + 7 = 10.
		

Crossrefs

Programs

  • Mathematica
    r = GoldenRatio; z = 12;
    u[n_] := u[n] = Floor[n*r]; v[n_] := v[n] = Floor[n*r^2];
    s[m_, n_] := s[m, n] = u[m] + v[n]; t = Table[s[m, n], {m, 1, z}, {n, 1, z}]
    TableForm[t] (* A259556 array *)
    Table[s[n - k + 1, k], {n, z}, {k, n, 1, -1}] // Flatten (* A259556 sequence *)

A356107 a(n) = A001950(A108598(n)).

Original entry on oeis.org

2, 7, 13, 18, 23, 26, 31, 36, 41, 47, 49, 54, 60, 65, 70, 73, 78, 83, 89, 94, 96, 102, 107, 112, 117, 123, 125, 130, 136, 141, 146, 149, 154, 159, 164, 170, 172, 178, 183, 188, 193, 196, 201, 206, 212, 217, 222, 225, 230, 235, 240, 246, 248, 253, 259, 264
Offset: 1

Views

Author

Clark Kimberling, Oct 02 2022

Keywords

Comments

This is the fourth of four sequences that partition the positive integers. See A356104.

Examples

			(1)  u o v = (3, 6, 9, 12, 17, 21, 24, 27, 32, 35, 38, 42, 46, ...) = A356104
(2)  u o v' = (1, 4, 8, 11, 14, 16, 19, 22, 25, 29, 30, 33, 37, ...) = A356105
(3)  u' o v = (5, 10, 15, 20, 28, 34, 39, 44, 52, 57, 62, 68, ...) = A356106
(4)  u' o v' = (2, 7, 13, 18, 23, 26, 31, 36, 41, 47, 49, 54, ...) = A356107
		

Crossrefs

Cf. u = A000201, u' = A001950, v = A022839, v' = A108598, A356104, A356105, A356106, A351415 (intersections), A356217 (reverse composites).

Programs

  • Mathematica
    z = 1000;
    u = Table[Floor[n*(1 + Sqrt[5])/2], {n, 1, z}];  (* A000201 *)
    u1 = Complement[Range[Max[u]], u];  (* A001950 *)
    v = Table[Floor[n*Sqrt[5]], {n, 1, z}];  (* A022839 *)
    v1 = Complement[Range[Max[v]], v];  (* A108598 *)
    zz = 120;
    Table[u[[v[[n]]]], {n, 1, zz}]    (* A356104 *)
    Table[u[[v1[[n]]]], {n, 1, zz}]   (* A356105 *)
    Table[u1[[v[[n]]]], {n, 1, zz}]   (* A356106 *)
    Table[u1[[v1[[n]]]], {n, 1, zz}]  (* A356107 *)

A255774 Tree of upper Wythoff numbers (A001950) generated as the 2-component of the graph described at A095903.

Original entry on oeis.org

2, 5, 7, 10, 13, 15, 20, 18, 23, 26, 34, 28, 36, 41, 54, 31, 39, 44, 57, 47, 60, 68, 89, 49, 62, 70, 91, 75, 96, 109, 143, 52, 65, 73, 94, 78, 99, 112, 146, 81, 102, 115, 149, 123, 157, 178, 233, 83, 104, 117, 151, 125, 159, 180, 235, 130, 164, 185, 240, 198
Offset: 1

Views

Author

Clark Kimberling, Mar 06 2015

Keywords

Comments

This sequence and A255773 partition the positive integers.

Examples

			To generate the tree of lazy Fibonacci representations as in A095903, start with 1,2. Suffix the next two Fibonacci numbers, getting 1+2, 1+3; 2+3, 2+5. Suffix the next two Fibonacci numbers, getting 1+2+3, 1+2+5, 1+3+5, 1+3+8; 2+3+5, 2+3+8, 2+5+8, 2+5+13. Continue forever. A255773 is the tree of numbers having root (initial summand) 1, and A255774 is the tree of numbers having root (initial summand) 2.
		

Crossrefs

Programs

  • Mathematica
    width = 6;t = Map[Total, Fibonacci[Flatten[NestList[Flatten[Map[{Join[#, {Last[#] +1}], Join[#, {Last[#] + 2}]} &, #], 1] &, {{2}, {3}}, width], 1]]](*A095903*)
    Map[t[[#]] &, Apply[Range, {2^Range[#] - 1, 3 2^(Range[#] - 1) - 2}]] &[width + 1] (*A255773*)
    Map[t[[#]] &,Apply[Range, {3 2^(Range[#] - 1) - 1, 2 (2^Range[#] - 1)}]] &[width + 1] (*A255774*) (* Peter J. C. Moses, Mar 06 2015 *)

A356220 a(n) = A108598(A001950(n)).

Original entry on oeis.org

3, 9, 12, 18, 23, 27, 32, 36, 41, 47, 50, 56, 61, 65, 70, 74, 79, 85, 88, 94, 97, 103, 108, 112, 117, 123, 126, 132, 135, 141, 146, 150, 155, 161, 164, 170, 173, 179, 184, 188, 193, 197, 202, 208, 211, 217, 222, 226, 231, 235, 240, 246, 249, 255, 258, 264
Offset: 1

Views

Author

Clark Kimberling, Nov 13 2022

Keywords

Comments

This is the fourth of four sequences that partition the positive integers. See A356217.

Examples

			(1)  v o u = (2, 6, 8, 13, 17, 20, 24, 26, 31, 35, 38, 42, ...) = A356217
(2)  v' o u = (1, 5, 7, 10, 14, 16, 19, 21, 25, 28, 30, 34, ...) = A356218
(3)  v o u' = (4, 11, 15, 22, 29, 33, 40, 44, 51, 58, 62, 76, ...) = A190509
(4)  v' o u' = (3, 9, 12, 18, 23, 27, 32, 36, 41, 47, 50, 56, ...) = A356220
		

Crossrefs

Cf. A000201, A001950, A022839, A108598, A351415 (intersections), A356104 (reverse composites), A356217, A356218, A356219.

Programs

  • Mathematica
    z = 1000;
    u = Table[Floor[n*(1 + Sqrt[5])/2], {n, 1, z}];  (* A000201 *)
    u1 = Complement[Range[Max[u]], u];  (* A001950 *)
    v = Table[Floor[n*Sqrt[5]], {n, 1, z}];  (* A022839 *)
    v1 = Complement[Range[Max[v]], v];  (* A108598 *)
    zz = 120;
    Table[v[[u[[n]]]], {n, 1, z/4}]   (* A356217 *)
    Table[v1[[u[[n]]]], {n, 1, z/4}]  (* A356218 *)
    Table[v[[u1[[n]]]], {n, 1, z/4}]  (* A190509 *)
    Table[v1[[u1[[n]]]], {n, 1, z/4}] (* A356220 *)
Showing 1-10 of 259 results. Next