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.

A252669 a(n) is the smallest integer k such that n*k mod (n+k) = 1, or -1 if no such k exists.

Original entry on oeis.org

1, 3, 2, 13, 8, 31, 3, 5, 32, 91, 50, 17, 4, 183, 98, 241, 12, 7, 162, 381, 5, 75, 30, 553, 288, 651, 46, 129, 392, 23, 6, 9, 76, 55, 578, 1261, 100, 47, 722, 1561, 17, 311, 7, 105, 968, 27, 18, 413, 1152, 11, 1250, 489, 228, 2863, 34, 3081, 8, 615, 1682, 217, 1800, 707
Offset: 1

Views

Author

Alex Ratushnyak, Jan 02 2015

Keywords

Crossrefs

Cf. A063427.

Programs

  • Mathematica
    sik[n_]:=Module[{k=1},While[Mod[n*k,n+k]!=1,k++];k]; Array[sik,70] (* Harvey P. Dale, Aug 15 2015 *)
  • PARI
    a(n) = k=1; while ((n*k) % (n+k) != 1, k++); k; \\ Michel Marcus, Jan 08 2015
  • Python
    import math
    for n in range(1,333):
        res=-1
        for k in range(2**31-1):
            if ((n*k) % (n+k) == 1):
                res=k
                break
        print(res, end=', ')
    

Formula

a(a(n)) <= n.