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-4 of 4 results.

A225481 a(n) = product{ p primes <= n+1 such that p divides n+1 or p-1 divides n }.

Original entry on oeis.org

1, 2, 6, 2, 30, 6, 42, 2, 30, 10, 66, 6, 2730, 14, 30, 2, 510, 6, 798, 10, 2310, 22, 138, 6, 2730, 26, 6, 14, 870, 30, 14322, 2, 5610, 34, 210, 6, 1919190, 38, 78, 10, 13530, 42, 1806, 22, 690, 46, 282, 6, 46410, 10, 1122, 26, 1590, 6, 43890, 14, 16530, 58
Offset: 0

Views

Author

Peter Luschny, May 29 2013

Keywords

Comments

a(n) is the product over the primes <= n+1 which satisfy the weak Clausen condition. The weak Clausen condition relaxes the Clausen condition (p-1)|n by logical disjunction with p|(n+1).

Examples

			a(20) = 2310 = 2*3*5*7*11, because {3, 7} are divisors of 21 and {2, 5, 11} meet the Clausen condition 'p-1 divides n'.
		

Crossrefs

Programs

  • Haskell
    a225481 n = product [p | p <- takeWhile (<= n + 1) a000040_list,
                             mod n (p - 1) == 0 || mod (n + 1) p == 0]
    -- Reinhard Zumkeller, Jun 10 2013
  • Maple
    divides := (a, b) -> b mod a = 0; primes := n -> select(isprime, [$2..n]);
    A225481 := n -> mul(k,k in select(p -> divides(p,n+1) or divides(p-1,n), primes(n+1))); seq(A225481(n), n = 0..57);
  • Mathematica
    a[n_] := Product[ If[ Divisible[n+1, p] || Divisible[n, p-1], p, 1], {p, Prime /@ Range @ PrimePi[n+1]}]; Table[a[n], {n, 0, 57}] (* Jean-François Alcover, Jun 07 2013 *)
  • Sage
    def divides(a, b): return b % a == 0
    def A225481(n):
        return mul(filter(lambda p: divides(p,n+1) or divides(p-1,n), primes(n+2)))
    [A225481(n) for n in (0..57)]
    

Formula

a(n) / A027760(n) = A226040(n) for n > 0.

A381639 Denominators of Sum_{i=1..omega(n)-1} p_{i}/p_{i+1}, where omega(n) = A001221(n) and p_1 < p_2 < ... p_omega(n) are the distinct prime factors of n; a(1) = 1.

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, 7, 3, 1, 19, 13, 5, 1, 21, 1, 11, 5, 23, 1, 3, 1, 5, 17, 13, 1, 3, 11, 7, 19, 29, 1, 15, 1, 31, 7, 1, 13, 33, 1, 17, 23, 35, 1, 3, 1, 37, 5, 19, 11, 39, 1
Offset: 1

Views

Author

Amiram Eldar, Mar 03 2025

Keywords

Comments

First differs from A119288 at n = 30.
First differs from {A226040(n-1)} at n = 35.
Also denominators of the fractions whose numerators are A381641.

Crossrefs

Cf. A001221, A119288, A226040, A381638 (numerators), A381640, A381641.

Programs

  • Mathematica
    a[n_] := Module[{p = FactorInteger[n][[;; , 1]]}, Denominator[Total[Most[p]/Rest[p]]]]; Array[a, 100]
  • PARI
    a(n) = {my(p = factor(n)[,1]); denominator(sum(i = 1, #p-1, p[i]/p[i+1]));}

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)

A226039 Numbers k such that there exist primes p which divide k+1 and p-1 does not divide k.

Original entry on oeis.org

5, 9, 11, 13, 14, 17, 19, 20, 21, 23, 25, 27, 29, 32, 33, 34, 35, 37, 38, 39, 41, 43, 45, 47, 49, 50, 51, 53, 54, 55, 56, 57, 59, 61, 62, 64, 65, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 101, 103
Offset: 1

Views

Author

Peter Luschny, May 27 2013

Keywords

Examples

			20 is in this list because 7 divides 21 but 6 does not divide 20.
		

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]));
    A226039_list := n -> select(k -> [] <> F(k), [$0..n]);
    A226039_list(103);
  • Mathematica
    selQ[n_] := AnyTrue[Prime[Range[PrimePi[n+1]]], Divisible[n+1, #] && !Divisible[n, #-1]&];
    Select[Range[103], selQ] (* Jean-François Alcover, Jul 08 2019 *)
  • Sage
    def F(n): return any(p for p in primes(n) if (n+1) % p == 0 and n % (p-1) != 0)
    def A226039_list(n): return list(filter(F, (0..n)))
    A226039_list(103)
Showing 1-4 of 4 results.