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.

Showing 1-2 of 2 results.

A226040 a(n) = product{ p prime such that p divides n + 1 and p - 1 does not divide n }.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 1, 5, 1, 3, 1, 7, 5, 1, 1, 3, 1, 5, 7, 11, 1, 3, 1, 13, 1, 7, 1, 15, 1, 1, 11, 17, 35, 3, 1, 19, 13, 5, 1, 21, 1, 11, 1, 23, 1, 3, 1, 5, 17, 13, 1, 3, 55, 7, 19, 29, 1, 15, 1, 31, 7, 1, 13, 33, 1, 17, 23, 35, 1, 3, 1, 37, 5, 19, 77, 39
Offset: 0

Views

Author

Peter Luschny, May 26 2013

Keywords

Examples

			a(41) = 21 = 3*7 = product({2,3,7} setminus {2}).
		

Crossrefs

Programs

  • Maple
    s:= (p, n) -> ((n+1) mod p = 0) and (n mod (p-1) <> 0);
    A226040 := n -> mul(z, z = select(p->s(p,n), select('isprime', [$2..n])));
    seq(A226040(n), n=0..77);
  • Mathematica
    a[n_] := Times @@ Select[ FactorInteger[n+1][[All, 1]], !Divisible[n, #-1] &]; a[0] = 1; Table[a[n], {n, 0, 77}] (* Jean-François Alcover, Jun 27 2013, after Maple *)
  • PARI
    a(n)=my(f=factor(n+1)[,1],s=1);prod(i=1,#f,if(n%(f[i]-1),f[i],1)) \\ Charles R Greathouse IV, Jun 27 2013
  • Sage
    def A226040(n):
        F = filter(lambda p: ((n+1) % p == 0) and (n % (p-1)), primes(n))
        return mul(F)
    [A226040(n) for n in (0..77)]
    

Formula

a(n) = A225481(n) / A141056(n).

A226038 Numbers k such that there are no primes p which divide k+1 and p-1 does not divide k.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 10, 12, 15, 16, 18, 22, 24, 26, 28, 30, 31, 36, 40, 42, 44, 46, 48, 52, 58, 60, 63, 66, 70, 72, 78, 80, 82, 88, 96, 100, 102, 106, 108, 112, 120, 124, 126, 127, 130, 136, 138, 148, 150, 156, 162, 166, 168, 172, 178, 180, 190, 192, 196, 198
Offset: 1

Views

Author

Peter Luschny, May 27 2013

Keywords

Comments

These are the numbers which satisfy the weak Clausen condition but not the Clausen condition.

Examples

			A counterexample is n = 14. 5 divides 15 but 4 does not divide 14.
		

Crossrefs

Programs

  • Maple
    s := (p,n) -> ((n+1) mod p = 0) and (n mod (p-1) <> 0);
    F := n -> select(p -> s(p,n), select('isprime', [$2..n]));
    A226038_list := n -> select(k -> [] = F(k), [$0..n]);
    A226038_list(200);
  • Mathematica
    s[p_, n_] := Mod[n+1, p] == 0 && Mod[n, p-1] != 0; f[n_] := Select[ Select[ Range[n], PrimeQ], s[#, n] &]; A226038 = Select[ Range[0, 200], f[#] == {} &] (* Jean-François Alcover, Jul 29 2013, after Maple *)
    Join[{0}, Select[Range[200], And @@ Divisible[#, FactorInteger[# + 1][[All, 1]] - 1] &]] (* Ivan Neretin, Aug 04 2016 *)
  • Sage
    def F(n): return filter(lambda p: ((n+1) % p == 0) and (n % (p-1) != 0), primes(n))
    def A226038_list(n): return list(filter(lambda n: not list(F(n)), (0..n)))
    A226038_list(200)
Showing 1-2 of 2 results.