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.

A364683 a(n) is the least k such that 1 + 2^k + 3^k is divisible by n, or -1 if there is no such k.

Original entry on oeis.org

0, 1, 0, 3, -1, 1, 2, -1, 3, -1, 9, 3, -1, 2, -1, -1, 9, 3, -1, -1, -1, 9, 5, -1, -1, -1, 9, -1, -1, -1, 16, -1, 9, 9, -1, 3, 12, -1, -1, -1, 18, -1, -1, 9, -1, 5, -1, -1, 4, -1, 9, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, 16, -1, -1, -1, 9, -1, 9, 5, -1, -1, -1, 19, 12, -1, -1, -1, -1, 33, -1, 27
Offset: 1

Views

Author

Robert Israel, Aug 02 2023

Keywords

Comments

If a(n) = -1, then a(m) = -1 for all multiples of n.

Examples

			a(7) = 2 because 1 + 2^2 + 3^2 = 14 is divisible by 7 while 1 + 2^0 + 3^0 = 3 and 1 + 2^1 + 3^1 = 6 are not.
		

Crossrefs

Cf. A001550.

Programs

  • Maple
    f:= proc(n) local k;
     for k from 0 to numtheory:-phi(n) + max(padic:-ordp(n,2), padic:-ordp(n,3)) do
       if 1 + 2&^k + 3&^k mod n = 0 then return k fi
     od;
     -1
    end proc:
    map(f, [$1..100]);