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

A022777 Place where n-th 1 occurs in A007337.

Original entry on oeis.org

1, 3, 7, 13, 20, 29, 40, 53, 67, 83, 101, 121, 142, 165, 190, 216, 244, 274, 306, 339, 374, 411, 450, 490, 532, 576, 622, 669, 718, 769, 821, 875, 931, 989, 1048, 1109, 1172, 1237, 1303, 1371, 1441, 1513, 1586, 1661, 1738, 1816, 1896, 1978, 2062
Offset: 1

Views

Author

Keywords

Comments

Also place where first n appears in A023116. First differences minus 1 are A022838. - Franklin T. Adams-Watters, Nov 10 2006

A022778 Place where n-th 1 occurs in A023116.

Original entry on oeis.org

1, 2, 4, 6, 9, 12, 16, 21, 26, 32, 38, 45, 52, 60, 69, 78, 88, 98, 109, 120, 132, 145, 158, 172, 186, 201, 217, 233, 250, 267, 285, 303, 322, 342, 362, 383, 404, 426, 448, 471, 495, 519, 544, 569, 595, 621, 648, 676, 704, 733, 762, 792, 823, 854
Offset: 1

Views

Author

Keywords

Comments

Also place where first n appears in A007337. - Franklin T. Adams-Watters, Nov 10 2006

Crossrefs

Programs

  • Mathematica
    Table[n + 1 + Sum[Floor[(n - k)/Sqrt[3]], {k, 0, n}], {n, 0, 200}] (* A022778 *)
    (* Clark Kimberling, Mar 14 2015 *)

Formula

a(n) = n + 1 + Sum{floor[(n - k)/sqrt(3)], k = 0..n}.

A007336 Signature sequence of sqrt 2 (arrange the numbers i+j*x (i,j >= 1) in increasing order; the sequence of i's is the signature of x).

Original entry on oeis.org

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

Views

Author

Keywords

References

  • Clark Kimberling, "Fractal Sequences and Interspersions", Ars Combinatoria, vol. 45 p 157 1997.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Take[ Transpose[ Sort[ Flatten[ Table[{i + j*Sqrt[2], i}, {i, 17}, {j, 15}], 1], #1[[1]] < #2[[1]] &]][[2]], 96] (* Robert G. Wilson v, Jul 24 2004 *)
    Quiet[Block[{$ContextPath}, Needs["Combinatorica`"]], {General::compat}]
    memos = <||>;
    zeroBasedC[theta_, i_] := zeroBasedC[theta, i] = Module[{memo, depth},
      memo = Lookup[memos, theta, {-1, 0}];
      While[memo[[-1]] <= i, AppendTo[memo, memo[[-1]] + Ceiling[theta * (Length[memo] - 1)]]];
      memos[i] = memo;
      depth = Combinatorica`BinarySearch[memo, i] - 3/2;
      If[IntegerQ[depth] && depth <= i, 1 + zeroBasedC[theta, i - depth], 0]
    ];
    A007336[i_] := zeroBasedC[2^(1/2), i - 1] + 1;
    Table[A007336[i], {i, 1, 100}] (* Brady J. Garvin, Aug 19 2024 *)
  • Python
    from bisect import bisect
    from collections import defaultdict
    from functools import cache
    from math import ceil
    memos = defaultdict(lambda: [-1, 0])
    @cache
    def zero_based_c(theta, i):
        memo = memos[theta]
        while memo[-1] <= i:
            memo.append(memo[-1] + ceil(theta * (len(memo) - 1)))
        depth = bisect(memo, i) - 1
        return 0 if depth > i or memo[depth] == i else 1 + zero_based_c(theta, i - depth)
    def A007336(i):
        return zero_based_c(2 ** 0.5, i - 1) + 1
    print([A007336(i) for i in range(1, 1001)])  # Brady J. Garvin, Aug 18 2024

Formula

If delete first occurrence of 1, 2, 3, ... the sequence is unchanged.

Extensions

More terms from Robert G. Wilson v, Jul 24 2004

A257811 Circle of fifths cycle (clockwise).

Original entry on oeis.org

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

Views

Author

Peter Woodward, May 09 2015

Keywords

Comments

The twelve notes dividing the octave are numbered 1 through 12 sequentially. This sequence begins at a certain note, travels up a perfect fifth (seven semitones) twelve times, and arrives back at the same note. If justly tuned fifths are used, the final note will be sharp by the Pythagorean comma (roughly 23.46 cents or about a quarter of a semitone).
Period 12: repeat [1, 8, 3, 10, 5, 12, 7, 2, 9, 4, 11, 6]. - Omar E. Pol, May 12 2015

Examples

			For a(3), 1+7+7 == 3 (mod 12).
For a(4), 1+7+7+7 == 10 (mod 12).
		

Crossrefs

Cf. A194835 (Contains this circle of fifths sequence), A007337 (sqrt(3) sequence), A258054 (counterclockwise circle of fifths cycle).

Programs

  • Magma
    [1+7*(n-1) mod(12): n in [1..80]]; // Vincenzo Librandi, May 10 2015
    
  • Mathematica
    PadRight[{}, 100, {1, 8, 3, 10, 5, 12, 7, 2, 9, 4, 11, 6}] (* Vincenzo Librandi, May 10 2015 *)
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},{1, 8, 3, 10, 5, 12, 7, 2, 9, 4, 11, 6},108] (* Ray Chandler, Aug 27 2015 *)
  • PARI
    a(n)=7*(n-1)%12+1 \\ Charles R Greathouse IV, Jun 02 2015
    
  • PARI
    Vec(x*(1 + 8*x + 3*x^2 + 10*x^3 + 5*x^4 + 12*x^5 + 7*x^6 + 2*x^7 + 9*x^8 + 4*x^9 + 11*x^10 + 6*x^11) / (1 - x^12) + O(x^80)) \\ Colin Barker, Nov 15 2019

Formula

Periodic with period 12: a(n) = 1 + 7*(n-1) mod 12.
From Colin Barker, Nov 15 2019: (Start)
G.f.: x*(1 + 8*x + 3*x^2 + 10*x^3 + 5*x^4 + 12*x^5 + 7*x^6 + 2*x^7 + 9*x^8 + 4*x^9 + 11*x^10 + 6*x^11) / (1 - x^12).
a(n) = a(n-12) for n > 12.
(End)

Extensions

Extended by Ray Chandler, Aug 27 2015

A167288 Signature sequence of Salem number 1.1762808182599176...

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 3, 2, 1, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 8, 1, 7, 6, 5, 4, 3, 9, 2, 8, 1, 7, 6, 5, 4, 10, 3, 9, 2, 8, 1, 7, 6, 5, 11, 4, 10, 3, 9, 2, 8, 1, 7, 6, 12, 5, 11, 4, 10, 3, 9, 2, 8, 1, 7, 13, 6, 12, 5, 11, 4, 10, 3, 9, 2, 8, 1, 14, 7, 13, 6, 12, 5, 11, 4, 10, 3, 9
Offset: 1

Views

Author

Roger L. Bagula, Nov 01 2009

Keywords

Crossrefs

Programs

  • Mathematica
    Mathematica code based on that for A007337 by Robert G. Wilson v.:
    m = x /. Solve[x^( 10) + x^9 - x^7 - x^6 - x^5 - x^4 - x^3 + x + 1 == 0, x][[2]]
    Take[Transpose[Sort[Flatten[Table[{i + j*m, i}, {i, 25}, {j, 17}], 1], #1[[1]] < #2[[1]] &]][[2]], 95]

A283940 Interspersion of the signature sequence of sqrt(3).

Original entry on oeis.org

1, 3, 2, 7, 5, 4, 13, 10, 8, 6, 20, 17, 14, 11, 9, 29, 25, 22, 18, 15, 12, 40, 35, 31, 27, 23, 19, 16, 53, 47, 42, 37, 33, 28, 24, 21, 67, 61, 55, 49, 44, 39, 34, 30, 26, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 101, 93, 86, 79, 72, 65, 59, 54, 48, 43, 38
Offset: 1

Views

Author

Clark Kimberling, Mar 19 2017

Keywords

Comments

Row n is the ordered sequence of numbers k such that A007337(k)=n. As a sequence, A283940 is a permutation of the positive integers. This is a transposable interspersion; i.e., every row intersperses all other rows, and every column intersperses all other columns.

Examples

			Northwest corner:
  1   3    7    13   20   29   40   53
  2   5    10   17   25   35   47   61
  4   8    14   22   31   42   55   70
  6   11   18   27   37   49   63   79
  9   15   23   33   44   57   72   89
  12  19   28   39   51   65   81   99
  16  24   34   46   59   74   91   110
  21  30   41   54   68   84   102  122
		

Crossrefs

Programs

  • Mathematica
    r = Sqrt[3]; z = 100;
    s[0] = 1; s[n_] := s[n] = s[n - 1] + 1 + Floor[n*r];
    u = Table[n + 1 + Sum[Floor[(n - k)/r], {k, 0, n}], {n, 0, z}] (* A022778, col 1 of A283940 *)
    v = Table[s[n], {n, 0, z}] (* A022777, row 1 of A283940*)
    w[i_, j_] := u[[i]] + v[[j]] + (i - 1)*(j - 1) - 1;
    Grid[Table[w[i, j], {i, 1, 10}, {j, 1, 10}]] (* A283940, array *)
    Flatten[Table[w[k, n - k + 1], {n, 1, 20}, {k, 1, n}]] (* A283940, sequence *)
  • PARI
    r = sqrt(3);
    z = 100;
    s(n) = if(n<1, 1, s(n - 1) + 1 + floor(n*r));
    p(n) = n + 1 + sum(k=0, n, floor((n - k)/r));
    u = v = vector(z + 1);
    for(n=1, 101, (v[n] = s(n - 1)));
    for(n=1, 101, (u[n] = p(n - 1)));
    w(i, j) = u[i] + v[j] + (i - 1) * (j - 1) - 1;
    tabl(nn) = {for(n=1, nn, for(k=1, n, print1(w(k, n - k + 1), ", "); );print(); ); };
    tabl(10) \\ Indranil Ghosh, Mar 21 2017
    
  • Python
    r = 3 ** 0.5
    def s(n): return 1 if n<1 else s(n - 1) + 1 + int(n*r)
    def p(n): return n + 1 + sum([int((n - k)/r) for k in range(0, n+1)])
    v=[s(n) for n in range(0, 101)]
    u=[p(n) for n in range(0, 101)]
    def w(i,j): return u[i - 1] + v[j - 1] + (i - 1) * (j - 1) - 1
    for n in range(1, 11):
        print ([w(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, Mar 21 2017
    
  • Python
    import numpy as np
    r = np.sqrt(3)
    x = np.arange(11)
    u = np.cumsum(np.ceil(x / r)).astype(int)
    v = np.cumsum(np.ceil(x * r)).astype(int)
    print(*[1 + u[k] + v[n-k] + k*(n-k) for n in range(11) for k in range(n+1)], sep=', ')
    # David Radcliffe, May 10 2025

A167286 Signature sequence of the smallest Pisot number (A060006).

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Nov 01 2009

Keywords

Crossrefs

Programs

  • Mathematica
    m = x /. Solve[x^3 - x - 1 == 0, x][[1]]
    Take[Transpose[Sort[Flatten[Table[{i + j*m, i}, {i, 25}, {j, 17}], 1], #1[[1]] < #2[[1]] &]][[2]], 95]

A167287 Signature sequence of Pisot number 1.3802775690976206... (A086106).

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Nov 01 2009

Keywords

Crossrefs

Programs

  • Mathematica
    m = x /. Solve[x^4 - x^3 - 1 == 0, x][[4]]
    Take[Transpose[Sort[Flatten[Table[{i + j*m, i}, {i, 25}, {j, 17}], 1], #1[[1]] < #2[[1]] &]][[2]], 95]
Showing 1-8 of 8 results.