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.

A309816 a(n) is the 2-adic valuation of A014664(n).

Original entry on oeis.org

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

Views

Author

Felix Fröhlich, Aug 18 2019

Keywords

Comments

Let p and q be distinct odd primes. Then there exists an integer i such that 2^i == -1 (mod p*q) if and only if a(u) = a(v) and a(u), a(v) > 0, where u and v are the indices of p and q in A000040, respectively (cf. Anderson, Preece, 2008, Lemma 1.4).

Examples

			For n = 7: A014664(7) = 8 and the 2-adic valuation of 8 is 3, since 2^3 = 8, so a(7) = 3.
		

Crossrefs

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