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.

A340741 Numbers k such that A340740(k) is prime.

Original entry on oeis.org

7, 8, 9, 11, 12, 13, 15, 18, 19, 28, 31, 32, 34, 36, 44, 46, 47, 51, 52, 62, 64, 67, 69, 70, 73, 83, 88, 109, 110, 112, 128, 148, 153, 159, 189, 190, 192, 206, 212, 214, 222, 224, 226, 244, 245, 261, 267, 269, 280, 282, 283, 287, 300, 305, 312, 315, 319, 323, 366, 370, 378, 381, 388, 394, 404
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 18 2021

Keywords

Examples

			a(3) = 9 is a term because A340740(9) = 2 is prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      add(`if`(igcd(k,n)=1, n mod k, 0),k=1..floor(n/2))
    end proc:
    select(t -> isprime(f(t)), [$1..1000]);
  • Mathematica
    A340741[n_] :=
      Position[Table[
         PrimeQ[Sum[
           Mod[m, i]*Floor[1/GCD[i, m]], {i, Floor[(m - 1)/2]}]], {m, 1,
          n}], True] // Flatten;
    A340741[404] (* Robert P. P. McKone, Jan 19 2021 *)
  • PARI
    isok(n) = isprime(sum(k=1, n\2, if (gcd(k, n)==1, n%k))); \\ Michel Marcus, Jan 18 2021