A309816 a(n) is the 2-adic valuation of A014664(n).
1, 2, 0, 1, 2, 3, 1, 0, 2, 0, 2, 2, 1, 0, 2, 1, 2, 1, 0, 0, 0, 1, 0, 4, 2, 0, 1, 2, 2, 0, 1, 2, 1, 2, 0, 2, 1, 0, 2, 1, 2, 0, 5, 2, 0, 1, 0, 1, 2, 0, 0, 3, 1, 4, 0, 2, 0, 2, 1, 1, 2, 1, 0, 2, 2, 1, 0, 1, 2, 3, 0, 0, 2, 1, 0, 2, 2, 3, 2, 1, 2, 0, 3, 0, 1, 5, 2
Offset: 2
Examples
For n = 7: A014664(7) = 8 and the 2-adic valuation of 8 is 3, since 2^3 = 8, so a(7) = 3.
Links
- I. Anderson and D. A. Preece, A general approach to constructing power-sequence terraces for Z_n, Discrete Mathematics, Vol. 308, No. 5-6 (2008), 631-644.
Programs
-
PARI
a(n) = valuation(znorder(Mod(2, prime(n))), 2);
-
Python
from sympy import n_order, prime def A309816(n): return (~(m:=n_order(2,prime(n))) & m-1).bit_length() # Chai Wah Wu, Nov 10 2023
Comments