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.

User: Peter Woodward

Peter Woodward's wiki page.

Peter Woodward has authored 17 sequences. Here are the ten most recent ones:

A367897 a(1)=1, a(n) = H_(n-2)(a(n-2), a(n-1)) where H_n is the n-th hyperoperator.

Original entry on oeis.org

1, 2, 3, 6, 729
Offset: 1

Author

Peter Woodward, Dec 04 2023

Keywords

Comments

The sequence follows the hierarchy of arithmetic operations (successorship, addition, multiplication, exponentiation, tetration, ...) with the recurrence a(n-2)?a(n-1)=a(n), where "?" follows the sequence of S (successor), +, *, ^, ^^ (tetration), ...
a(6) (=6^^729) is too large to be represented.
Essentially a Fibonacci generalization: the Fibonacci hyperoperation sequence starting with 1.

Examples

			a(1)=1, a(2)=S(a(1)), a(3)=a(1)+a(2), a(4)=a(2)*a(3), a(5)=a(3)^a(4), a(6)=a(4)^^a(5), ...a(1) = 1
a(2) = H_0(a(1), a(1)) = 1 + 1 = 2 (successor of 1 = 2)
a(3) = H_1(a(1), a(2)) = 1 + 2 = 3
a(4) = H_2(a(2), a(3)) = 2 * 3 = 6
a(5) = H_3(a(3), a(4)) = 3^6 = 729
		

Crossrefs

Cf. A054871.

A364843 Integers are repeated in runs of 1, 2, 3, ... Each new integer (following a run) is given the value of its sequence index value.

Original entry on oeis.org

1, 2, 2, 4, 4, 4, 7, 7, 7, 7, 11, 11, 11, 11, 11, 16, 16, 16, 16, 16, 16, 22, 22, 22, 22, 22, 22, 22, 29, 29, 29, 29, 29, 29, 29, 29, 37, 37, 37, 37, 37, 37, 37, 37, 37, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56
Offset: 1

Author

Peter Woodward, Aug 10 2023

Keywords

Comments

Omitting repeats yields the triangular numbers plus 1 sequence A000124.

Examples

			Illustrated as a triangle begins:
   1;
   2,  2;
   4,  4,  4;
   7,  7,  7,  7;
  11, 11, 11, 11, 11;
  16, 16, 16, 16, 16, 16;
  22, 22, 22, 22, 22, 22, 22;
  ...
		

Crossrefs

Row sums give A006000(n-1).

Programs

  • Maple
    T:= (n, k)-> n*(n-1)/2+1:
    seq(seq(T(n,k), k=1..n), n=1..11);  # Alois P. Heinz, Aug 31 2023
  • PARI
    a(n) = my(t=(sqrtint(8*n-1)-1)\2); t*(t+1)/2+1 \\ Thomas Scheuerle, Aug 10 2023
    
  • Python
    from math import isqrt
    def A364843(n): return ((t:=isqrt((n<<3)-1)-1>>1)*(t+1)>>1)+1 # Chai Wah Wu, Sep 15 2023

Formula

G.f.: x*y*(1 + 2*x^4*y^2 - x*(1 + y) - 2*x^3*y*(1 + y) + x^2*(1 + y + y^2))/((1 - x)^3*(1 - x*y)^3). - Stefano Spezia, Sep 02 2023
Sum_{k=1..n} k = T(n,k) = A006528(n). - Alois P. Heinz, Sep 15 2023

A356464 Number of black keys in each group of black keys on a standard 88-key piano (left to right).

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3
Offset: 1

Author

Peter Woodward, Aug 08 2022

Keywords

Comments

On a standard piano keyboard, the black keys appear in groups of two and three, with each group separated from adjacent groups by the presence of two white keys that have no black key between them.
The black keys in a group of two are C#/Db and D#/Eb; the black keys in a group of three are F#/Gb, G#/Ab, and A#/Bb.
The A#/Bb key near the left end of the keyboard is a special case; it is the only black key in its group because the white A key to its left is the leftmost key on the keyboard.

Examples

			From _Jon E. Schoenfield_, Aug 12 2022: (Start)
In the diagram below, five octaves (i.e., sets of 12 consecutive keys) have been omitted (as represented by the ellipses):
.
    n |  1       2         3       ...     14        15
  ----+---------------------------------------------------------
  a(n)|  1       2         3       ...      2         3
    ______________________________ ... _________________________
      | |/| | |/||/| | |/||/||/| |     | |/||/| | |/||/||/| |  |
      | |/| | |/||/| | |/||/||/| |     | |/||/| | |/||/||/| |  |
      | |/| | |/||/| | |/||/||/| |     | |/||/| | |/||/||/| |  |
      | |_| | |_||_| | |_||_||_| |     | |_||_| | |_||_||_| |  |
      |  |  |  |  |  |  |  |  |  |     |  |  |  |  |  |  |  |  |
      |  |  |  |  |  |  |  |  |  |     |  |  |  |  |  |  |  |  |
      |__|__|__|__|__|__|__|__|__|     |__|__|__|__|__|__|__|__|
       A  B  C  D  E  F  G  A  B   ...  C  D  E  F  G  A  B  C
(End)
		

Crossrefs

A346261 Lexicographically earliest sequence of decimal words starting with 10 such that each term has Hamming distance at least 2 from all earlier terms.

Original entry on oeis.org

10, 21, 32, 43, 54, 65, 76, 87, 98, 100, 111, 122, 133, 144, 155, 166, 177, 188, 199, 201, 212, 220, 234, 245, 253, 267, 278, 286, 302, 313, 324, 330, 341, 356, 368, 375, 389, 397, 403, 414, 425, 431, 440, 452, 469, 496, 504, 515, 523, 536, 542, 550, 561, 579, 605, 616, 627, 638, 649, 651
Offset: 1

Author

Peter Woodward, Jul 11 2021

Keywords

Examples

			a(1) = 10 by definition.
a(2) = 21 because '2' has not yet appeared in the tens place and '1' has not yet appeared in the ones place.
		

Crossrefs

Lexicodes of minimal distance 1,2,3,... over alphabets of size 2: A001477, A001969, A075926, A075928, A075931, A075934, ...; size 3: A001477, A346002, A346003; size 10: A001477, A343444, A333568, A346000, A346001.
Cf. A207063.

Programs

  • Python
    def ham(m, n):
        s, t = str(min(m, n))[::-1], str(max(m, n))[::-1]
        return len(t) - len(s) + sum(s[i] != t[i] for i in range(len(s)))
    def aupton(terms):
        alst = [10]
        for n in range(2, terms+1):
            an = alst[-1] + 1
            while any(ham(an, aprev) < 2 for aprev in alst[::-1]):  an += 1
            alst.append(an)
        return alst
    print(aupton(60)) # Michael S. Branicky, Jul 22 2021

Extensions

Edited and corrected by N. J. A. Sloane, Jul 20 2021

A309663 Primes that begin a run of consecutive primes whose first differences are nondecreasing.

Original entry on oeis.org

2, 13, 19, 31, 41, 61, 71, 83, 101, 109, 131, 139, 151, 167, 181, 193, 199, 227, 241, 257, 271, 281, 311, 337, 349, 373, 383, 401, 421, 433, 443, 461, 487, 503, 523, 547, 563, 571, 593, 601, 617, 641, 661, 677, 709, 727, 743, 757, 773, 797, 811, 823, 829, 857
Offset: 1

Author

Peter Woodward, Jun 06 2020

Keywords

Comments

Arrange primes in rows where the value of the increase between consecutive primes cannot shrink.
Conjecture: Average length of each run = e, converging from above.
Heuristic justification: Consider that e = 2 + 1/2! + 1/3! + 1/4! + ... We always have at least two values in a run. The odds of there being a third value = 1/2!. The odds of there being a fourth value = 1/3! (because exactly 3! ways to sort three differences, and only one of these ways is in increasing order). etc... The process is aberrated by the possibility of equal increases. This sequence allows equal increases in the runs, causing the convergence to e to approach from above. However, as the scale increases, these equal increases occur less frequently and their effect approaches zero. The sister sequence, "Primes that begin a run of consecutive primes whose first differences are strictly increasing", disallows equal increases in its rows, thus it approaches e from below. Averaging the runs of the two sequences negates the aberration, giving immediate convergence to e.

Examples

			The first run is 2, 3, 5, 7, 11, thus the first value is 2;
The second run is 13, 17, thus the second value is 13;
The third run is 19, 23, 29, thus the third value is 19;
The fourth run is 31, 37, thus the fourth value is 31.
		

Crossrefs

Same process as A331544 except this allows equal increases in the runs.

Programs

  • PARI
    lista(nn) = {my(d=m=2); forprime(p=2, nn, if(p-mJinyuan Wang, Jul 09 2020

Extensions

More terms from Jinyuan Wang, Jul 09 2020

A331544 Primes that begin a run of consecutive primes whose first differences are strictly increasing.

Original entry on oeis.org

2, 7, 13, 19, 31, 41, 59, 71, 83, 101, 109, 131, 139, 151, 163, 179, 193, 199, 223, 229, 241, 257, 269, 281, 311, 337, 349, 373, 383, 401, 421, 433, 443, 461, 487, 503, 523, 547, 563, 571, 593, 601, 613, 619, 641, 659, 677, 709, 727, 739, 757, 773, 797, 811, 823
Offset: 1

Author

Peter Woodward, Jan 19 2020

Keywords

Comments

Arrange primes in rows where the value of the increase between consecutive primes must keep increasing.
Conjecture: Average length of each run = e, converging from below.
Comment from Peter Woodward, Apr 22 2023: (Start)
Heuristic justification: Consider that e = 2 + 1/2! + 1/3! + 1/4! + ... We always have at least two values in a run. The probability that there is a third value is 1/2!. The probability that there is a fourth value is 1/3! (because there are exactly 3! ways to sort three differences, and only one of these ways is in increasing order). And so on. The process is distorted by the possibility of equal increases. This sequence disallows equal increases in the runs, causing the convergence to e to approach from below. However, as the scale increases, these equal increases occur less frequently and their effect approaches zero. The sister sequence, "Primes that begin a run of consecutive primes whose first differences are nondecreasing", includes equal increases in its rows, thus it approaches e from above. Averaging the runs of the two sequences should negate the aberration, giving immediate convergence to e. However, while using a set of random numbers arranged in this fashion does immediately converge to e, with primes the convergence is slowed for unknown reasons, and the average run length remains slightly below e with extensive calculation (after 10^7 runs it reaches 2.712 vs. 2.718...).
The probability that a randomly chosen integer n is prime is approximately 1/log(n) (by the prime number theorem). Thus, the expected gap between consecutive primes of size k is approximately (1/log(n)) * (1 - 1/log(n))^k - 1.
Using the above formula, we can calculate the expected length of the k-th set as follows:
E(length of k-th set) = Sum_{n>=m+1} ((1/log(n)) * (1 - 1/log(n))^k - 1) where m is the largest prime less than or equal to the starting prime of the k-th set.
(End)

Examples

			The first run is 2, 3, 5, thus the first value is 2;
the second run is 7, 11, thus the second value is 7;
the third run is 13, 17, thus the third value is 13;
the fourth run is 19, 23, 29, thus the fourth value is 19.
		

Crossrefs

Cf. A309663.

Programs

  • PARI
    lista(nn) = {my(m=2, d=0); forprime(p=2, nn, if(p-m>d, d=p-m, d=0; print1(p, ", ")); m=p); } \\ Jinyuan Wang, Jan 21 2020

Extensions

More terms from Jinyuan Wang, Jan 21 2020

A260517 Numbers equidistant from twin prime pairs that are also equidistant from numbers equidistant from twin prime pairs.

Original entry on oeis.org

51, 105, 144, 165, 234, 255, 276, 630, 1041, 2289, 2325, 2466, 4251, 5460, 9006, 9699, 10380, 10479, 12006, 13701, 14166, 15690, 18090, 19425, 20190, 20295, 21540, 26706, 26796, 32487, 32871, 33684, 33789, 35520, 37455, 38661, 41685, 42771, 46515, 47760
Offset: 1

Author

Peter Woodward, Jul 27 2015

Keywords

Examples

			165 is a term because it is equidistant from 144 and 186. 144 and 186 are both equidistant from twin primes, according to A074953.
		

Crossrefs

Cf. A001097 (Twin primes), A074953 (Numbers equidistant from twin prime pairs).

Programs

  • Mathematica
    t = Select[ Prime@ Range@ 5000, PrimeQ[# + 2] &]; d = Differences@ t; (t[[#+1]] + t[[#+2]]& /@ Select[ Range[ Length[d] - 2], d[[#]] == d[[#+2]] &])/2 + 1 (* Robert G. Wilson v, Jul 29 2015 *)

A261038 a(1)=1; for n>1: a(n) = a(n-1)*n if t=0, a(n) = round(a(n-1)/n) if t=1, a(n) = a(n-1)+n if t=2, a(n) = a(n-1)-n if t=3, where t = n mod 4.

Original entry on oeis.org

1, 3, 0, 0, 0, 6, -1, -8, -1, 9, -2, -24, -2, 12, -3, -48, -3, 15, -4, -80, -4, 18, -5, -120, -5, 21, -6, -168, -6, 24, -7, -224, -7, 27, -8, -288, -8, 30, -9, -360, -9, 33, -10, -440, -10, 36, -11, -528, -11, 39, -12, -624, -12, 42, -13, -728, -13, 45, -14
Offset: 1

Author

Peter Woodward, Aug 07 2015

Keywords

Comments

a(4*n+1) = 1, 0, -1, -2, -3, ...
a(4*n+2) = 3, 6, 9, 12, 15, ...
a(4*n+3) = 0, -1, -2, -3, -4, ...
a(4*n+4) = 0, -8, -24, -48, -80, ... = -A033996(n).

Examples

			a(1) =                    1.
a(2) =       a(1) + 2  =  3.
a(3) =       a(2) - 3  =  0.
a(4) =       a(3) * 4  =  0.
a(5) = round(a(4) / 5) =  0.
a(6) =       a(5) + 6  =  6.
a(7) =       a(6) - 7  = -1.
		

Crossrefs

Cf. A033996.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1, (t->
          `if`(t=0, a(n-1)*n, `if`(t=1, round(a(n-1)/n),
          `if`(t=2, a(n-1)+n, a(n-1)-n))))(irem(n, 4)))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 08 2015
  • Mathematica
    nxt[{n_,a_}]:=Module[{t=Mod[n+1,4]},{n+1,Which[t==0,a(n+1), t==1,Round[ a/(n+1)], t==2,a+n+1,t==3,a-n-1]}]; NestList[nxt,{1,1},100][[All,2]] (* or *) LinearRecurrence[{0,0,0,3,0,0,0,-3,0,0,0,1},{1,3,0,0,0,6,-1,-8,-1,9,-2,-24},100] (* Harvey P. Dale, May 25 2018 *)
  • PARI
    Vec(-x*(x^10+2*x^8-8*x^7-x^6-3*x^5-3*x^4+3*x+1)/((x-1)^3*(x+1)^3*(x^2+1)^3) + O(x^100)) \\ Colin Barker, Aug 10 2015
    
  • PARI
    first(m)=my(v=vector(m),t);v[1]=1;for(i=2,m,t = i%4;if(t==0,v[i]=v[i-1]*i,if(t==1,v[i]=round(v[i-1]/i),if(t==2,v[i]=v[i-1]+i,v[i]=v[i-1]-i ))));v; \\ Anders Hellström, Aug 17 2015

Formula

From Colin Barker, Aug 09 2015: (Start)
a(n) = 3*a(n-4) - 3*a(n-8) + a(n-12).
G.f.: -x*(x^10+2*x^8-8*x^7-x^6-3*x^5-3*x^4+3*x+1) / ((x-1)^3*(x+1)^3*(x^2+1)^3).
(End)

Extensions

More terms from Alois P. Heinz, Aug 08 2015
Edited by Jon E. Schoenfield, Aug 08 2015
Corrected by Harvey P. Dale, May 25 2018

A260548 a(n) = prime(1)^prime(2)^prime(3)^...^prime(n).

Original entry on oeis.org

2, 8, 14134776518227074636666380005943348126619871175004951664972849610340958208
Offset: 1

Author

Peter Woodward, Jul 29 2015

Keywords

Examples

			a(1) = 2; a(2) = 2^3; a(3) = 2^3^5.
		

Crossrefs

A258054 Circle of fifths cycle (counterclockwise).

Original entry on oeis.org

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

Author

Peter Woodward, May 17 2015

Keywords

Comments

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

Examples

			For a(3), 1+5+5 = 11 (mod 12).
For a(4), 1+5+5+5 = 4 (mod 12).
		

Crossrefs

Cf. A221363 (Pythagorean comma), A257811 (clockwise circle of fifths cycle).

Programs

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

Formula

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

Extensions

Extended by Ray Chandler, Aug 27 2015