A220952 A twisted enumeration of the nonnegative integers.
0, 1, 2, 3, 4, 9, 14, 19, 18, 17, 16, 11, 12, 13, 8, 7, 6, 5, 10, 15, 20, 21, 22, 23, 24, 49, 74, 99, 98, 97, 96, 71, 72, 73, 48, 47, 46, 45, 70, 95, 90, 85, 80, 55, 60, 65, 40, 35, 30, 31, 32, 33, 38, 37, 36, 41, 42, 43, 68, 67, 66, 61, 62, 63, 58, 57, 56, 81, 82, 83, 88
Offset: 0
Examples
48 (equals 143 in base 5) is adjacent to 47 = 142_5 and 73 = 243_5, hence 48 follows 73 and precedes 47.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..15624
- Donald Knuth (Proposer), A twisted enumeration of the positive integers; Problem 11733, Amer. Math. Monthly, 120 (9) (2013), 76.
- R. J. Mathar, Maple program for A220952.
- Richard Stong (Solver), A twisted enumeration of the positive integers; Solution to Problem 11733, Amer. Math. Monthly, 123 (1) (2016), 98-100. See here for another link.
- Richard Stong (Solver), A twisted enumeration of the positive integers; Solution to Problem 11733, Amer. Math. Monthly, 123 (1) (2016), 98-100. [Annotated scanned copy]
- Index to sequences related to permutations of the nonnegative integers
Programs
-
Maple
# See the link, R. J. Mathar, Aug 25 2017
-
PARI
isAdj(a,b)={a=Vec(digits(min(a,b),5),-#b=concat(0,digits(max(a,b),5))); normlp(a-b,1)<2 && !for(j=2,#b, for(i=1,j-1, if(a[i]==b[i], !a[i] || a[i]==4 || (a[i]==3 && min(a[j],b[j])) || (a[i]==1 && max(a[j],b[j])<4) || (a[i]==2 && !#setminus(Set([a[j],b[j]]),[1,2,3])) || a[j]==b[j], (!a[j] && min(a[i],b[i])) || (a[j]==4 && max(a[i],b[i])<4) || (a[j]==1 && Set([a[i],b[i]])==[2,3]) || (a[j]==3 && Set([a[i],b[i]])==[1,2]) || a[i]==b[i]) || return))} u=[];for(n=a=0,100,print1(a",");u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1,u=u[^1]); for(k=u[1]+1,oo,!setsearch(u,k)&&isAdj(a,k)&&(a=k)&&next(2))) \\ M. F. Hasler, Mar 13 2018
Extensions
Extended beyond a(25) by R. J. Mathar, Aug 25 2017
Comments