A256295 Apply the transformation 0 -> 1 -> 2 -> 3 -> 4 -> 0 to the digits of n written in base 5, then convert back to base 10.
1, 2, 3, 4, 0, 11, 12, 13, 14, 10, 16, 17, 18, 19, 15, 21, 22, 23, 24, 20, 1, 2, 3, 4, 0, 56, 57, 58, 59, 55, 61, 62, 63, 64, 60, 66, 67, 68, 69, 65, 71, 72, 73, 74, 70, 51, 52, 53, 54, 50, 81, 82, 83, 84, 80, 86, 87, 88, 89, 85
Offset: 0
Examples
a(5) = 11 because 5 = 10[5] becomes 21[5] = 11. a(24) = 0 because 24 = 44[5] becomes 00[5] = 0.
Programs
-
PARI
A256295(n,b=5)=!n+apply(t->(t+1)%b,n=digits(n,b))*vector(#n,i,b^(#n-i))~
Comments