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.

A332072 The Blue Comma sequence: Differences of indices of even terms gives back the sequence; lexicographically earliest such permutation of positive integers.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 7, 9, 8, 11, 13, 10, 15, 17, 19, 21, 23, 12, 25, 27, 29, 31, 14, 33, 35, 37, 39, 41, 43, 16, 45, 47, 49, 51, 53, 55, 57, 59, 18, 61, 63, 65, 67, 69, 71, 73, 20, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 22, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 24, 119, 121, 123, 125, 127
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, May 19 2020

Keywords

Examples

			The even terms are at indices 2, 3, 5, 9, 12, 18, 23, 30, ...; first differences give 1, 2, 4, 3, 6, 5, 7, ... = the sequence itself.
		

Crossrefs

Cf. A197756 (the Yellow Comma sequence: count digits between odd terms).

Programs

  • PARI
    upto(N)={my(a=Vec([1,2],N),i=1,L=2); local(U=[2], nxt(e)=while(#U>1&&U[2]==U[1]+1, U=U[^1]); my(t=U[1]); until( t++%2!=e && !setsearch(U,t),); U=setunion(U,[t]);t ); for(n=3,N,a[n]=nxt(n-L==a[i] && i++ && L=n));a}