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-10 of 34 results. Next

A002034 Kempner numbers: smallest positive integer m such that n divides m!.

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 4, 6, 5, 11, 4, 13, 7, 5, 6, 17, 6, 19, 5, 7, 11, 23, 4, 10, 13, 9, 7, 29, 5, 31, 8, 11, 17, 7, 6, 37, 19, 13, 5, 41, 7, 43, 11, 6, 23, 47, 6, 14, 10, 17, 13, 53, 9, 11, 7, 19, 29, 59, 5, 61, 31, 7, 8, 13, 11, 67, 17, 23, 7, 71, 6, 73, 37, 10, 19, 11, 13, 79, 6, 9, 41, 83, 7
Offset: 1

Views

Author

Keywords

Comments

Sometimes named after Florentin Smarandache, although studied 60 years earlier by Aubrey Kempner and 35 years before that by Lucas.
Kempner originally defined a(1) to be 0, and there are good reasons to prefer that (see Hungerbühler and Specker), but we shall stay with the by-now traditional value a(1) = 1. - N. J. A. Sloane, Jan 02 2021
Kempner gave an algorithm to compute a(n) from the prime factorization of n. Partial solutions were given earlier by Lucas in 1883 and Neuberg in 1887. - Jonathan Sondow, Dec 23 2004
a(n) is the degree of lowest degree monic polynomial over Z that vanishes identically on the integers mod n [Newman].
Smallest k such that n divides product of k consecutive integers starting with n + 1. - Amarnath Murthy, Oct 26 2002
If m and n are any integers with n > 1, then |e - m/n| > 1/(a(n) + 1)! (see Sondow 2006).
Degree of minimal linear recurrence satisfied by Bell numbers (A000110) read modulo n. [Lunnon et al.] - N. J. A. Sloane, Feb 07 2009

Examples

			1! = 1, but clearly 8 does not divide 1.
2! = 2, but 8 does not divide 2.
3! = 6, but 8 does not divide 6.
4! = 24, and 8 does divide 24. Hence a(8) = 4.
However, 9 does not divide 24.
5! = 120, but 9 does not divide 120.
6! = 720, and 9 does divide 720. Hence a(9) = 6.
		

References

  • E. Lucas, Question Nr. 288, Mathesis 3 (1883), 232.
  • R. Muller, Unsolved problems related to Smarandache Function, Number Theory Publishing Company, Phoenix, AZ, ISBN 1-879585-37-5, 1993.
  • J. Neuberg, Solutions des questions proposées, Question Nr. 288, Mathesis 7 (1887), 68-69.
  • Donald J. Newman, A Problem Seminar. Problem 17, Springer-Verlag, 1982.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Florentin Smarandache, A Function in the Number Theory, Analele Univ. Timisoara, Fascicle 1, Vol. XVIII, 1980, pp. 79-88; Smarandache Function J., Vol. 1, No. 1-3 (1990), pp. 3-17.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 2.5.18 on page 77.

Crossrefs

Cf. A000142, A001113, A006530, A007672, A046022, A057109, A064759, A084945, A094371, A094372, A094404, A122378, A122379, A122416, A122417, A248937 (Fermi-Dirac analog: use unique representation of n > 1 as a product of distinct terms of A050376).
See A339594-A339596 for higher-dimensional generalizations.

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a002034 1 = 1
    a002034 n = fromJust (a092495 n `elemIndex` a000142_list)
    -- Reinhard Zumkeller, Aug 24 2011
    
  • Maple
    a:=proc(n) local b: b:=proc(m) if type(m!/n, integer) then m else fi end: [seq(b(m),m=1..100)][1]: end: seq(a(n),n=1..84); # Emeric Deutsch, Aug 01 2005
    g:= proc(p,u)
      local i,t;
      t:= 0;
      for i from 1 while t < u do
        t:= t + 1 + padic[ordp](i,p);
      od;
      p*(i-1)
    end;
    A002034:= x -> max(map(g@op, ifactors(x)[2])); # Robert Israel, Apr 20 2014
  • Mathematica
    Do[m = 1; While[ !IntegerQ[m!/n], m++ ]; Print[m], {n, 85}] (* or for larger n's *)
    Kempner[1] := 1; Kempner[n_] := Max[Kempner @@@ FactorInteger[n]]; Kempner[p_, 1] := p; Kempner[p_, alpha_] := Kempner[p, alpha] = Module[{a, k, r, i, nu, k0 = alpha(p - 1)}, i = nu = Floor[Log[p, 1 + k0]]; a[1] = 1; a[n_] := (p^n - 1)/(p - 1); k[nu] = Quotient[alpha, a[nu]]; r[nu] = alpha - k[nu]a[nu]; While[r[i] > 0, k[i - 1] = Quotient[r[i], a[i - 1]]; r[i - 1] = r[i] - k[i - 1]a[i - 1]; i-- ]; k0 + Plus @@ k /@ Range[i, nu]]; Table[ Kempner[n], {n, 85}] (* Eric W. Weisstein, based on a formula of Kempner's, May 17 2004 *)
    With[{facts = Range[100]!}, Flatten[Table[Position[facts, ?(Divisible[#, n] &), {1}, 1], {n, 90}]]] (* _Harvey P. Dale, May 24 2013 *)
  • PARI
    a(n)=if(n<0,0,s=1; while(s!%n>0,s++); s)
    
  • PARI
    a(n)=my(s=factor(n)[,1],k=s[#s],f=Mod(k!,n));while(f, f*=k++); k \\ Charles R Greathouse IV, Feb 28 2012
    
  • PARI
    valp(n,p)=my(s);while(n\=p,s+=n);s
    K(p,e)=if(e<=p,return(e*p));my(t=e*(p-1)\p*p);while(valp(t+=p,p)Charles R Greathouse IV, Jul 30 2013
    
  • Python
    from sympy import factorial
    def a(n):
        m=1
        while True:
            if factorial(m)%n==0: return m
            else: m+=1
    [a(n) for n in range(1, 101)] # Indranil Ghosh, Apr 24 2017
    
  • Python
    from sympy import factorint
    def valp(n, p):
        s = 0
        while n: n //= p; s += n
        return s
    def K(p, e):
        if e <= p: return e*p
        t = e*(p-1)//p*p
        while valp(t, p) < e: t += p
        return t
    def A002034(n):
        return 1 if n == 1 else max(K(p, e) for p, e in factorint(n).items())
    print([A002034(n) for n in range(1, 85)]) # Michael S. Branicky, Jun 09 2022 after Charles R Greathouse IV

Formula

A000142(a(n)) = A092495(n). - Reinhard Zumkeller, Aug 24 2011
From Joerg Arndt, Jul 14 2012: (Start)
The following identities were given by Kempner (1918):
a(1) = 1.
a(n!) = n.
a(p) = p for p prime.
a(p1 * p2 * ... * pu) = pu if p1 < p2 < ... < pu are distinct primes.
a(p^k) = p * k for p prime and k <= p.
Let n = p1^e1 * p2^e2 * ... * pu^eu be the canonical factorization of n, then a(n) = max( a(p1^e1), a(p2^e2), ..., a(pu^eu) ).
(End)
Clearly a(n) >= P(n), the largest prime factor of n (= A006530). a(n) = P(n) for almost all n (Erdős and Kastanas 1994, Ivic 2004). The exceptions are A057109. a(n) = P(n) if and only if a(n) is prime because if a(n) > P(n) and a(n) were prime, then since n divides a(n)!, n would also divide (a(n)-1)!, contradicting minimality of a(n). - Jonathan Sondow, Jan 10 2005
If p is prime then a(p^k) = k*p for 0 <= k <= p. Hence it appears also that if n = 2^m * p(1)^e(1) * ... * p(r)^e(r) and if there exists b, 1 <= b <= r, such that Max(2 * m + 2, p(i) * e(i), 1 <= i <= r) = p(b) * e(b) with e(b) <= p(b) then a(n) = e(b) * p(b). E.g.: a(2145986896455317997802121296896) = a(2^10 * 3^3 * 7^9 * 11^9 * 13^8) = 13 * 8 = 104, since 8 * 13 = Max (2 * 10 + 2, 3 * 3, 7 * 9, 11 * 9, 13 * 8) and 8 <= 13. - Benoit Cloitre, Sep 01 2002
It appears that a(2^m - 1) is the largest prime factor of 2^m - 1 (A005420).
a(n!) = n for all n > 0 and a(p) = p if p is prime. - Jonathan Sondow, Dec 23 2004
Conjecture: a(n) = 1 + n - Sum_{k=1..n} Sum_{m=1..n} cos(-2*Pi*k/n*m!)/n. Formula verified for the first 500 terms. - Mats Granvik, Feb 26 2021
Limit_{n->oo} (1/n) * Sum_{k=2..n} log(a(k))/log(k) = A084945 (Finch, 1999). - Amiram Eldar, Jul 04 2021

Extensions

Error in 45th term corrected by David W. Wilson, May 15 1997

A001605 Indices of prime Fibonacci numbers.

Original entry on oeis.org

3, 4, 5, 7, 11, 13, 17, 23, 29, 43, 47, 83, 131, 137, 359, 431, 433, 449, 509, 569, 571, 2971, 4723, 5387, 9311, 9677, 14431, 25561, 30757, 35999, 37511, 50833, 81839, 104911, 130021, 148091, 201107, 397379, 433781, 590041, 593689, 604711, 931517, 1049897, 1285607, 1636007, 1803059, 1968721, 2904353, 3244369, 3340367
Offset: 1

Views

Author

Keywords

Comments

Some of the larger entries may only correspond to probable primes.
Since F(n) divides F(mn) (cf. A001578, A086597), all terms of this sequence are primes except for a(2) = 4 = 2 * 2 but F(2) = 1. - M. F. Hasler, Dec 12 2007
What is the next larger twin prime after F(4) = 3, F(5) = 5, F(7) = 13? The next candidates seem to be F(104911) or F(1968721) (greater of a pair), or F(397379), F(931517) (lesser of a pair). - M. F. Hasler, Jan 30 2013, edited Dec 24 2016, edited Sep 23 2017 by Bobby Jacobs
_Henri Lifchitz_ confirms that the data section gives the full list (49 terms) as far as we know it today of indices of prime Fibonacci numbers (including proven primes and PRPs). - N. J. A. Sloane, Jul 09 2016
Terms n such that n-2 is also a term are listed in A279795. - M. F. Hasler, Dec 24 2016
There are no Fibonacci numbers that are twin primes after F(7) = 13. Every Fibonacci prime greater than F(4) = 3 is of the form F(2*n+1). Since F(2*n+1)+2 and F(2*n+1)-2 are F(n+2)*L(n-1) and F(n-1)*L(n+2) in some order, and F(n+2) > 1, L(n-1) > 1, F(n-1) > 1, and L(n+2) > 1 for n > 3. - Bobby Jacobs, Sep 23 2017
These primes are occurring with about the same normalized frequency as Repunit primes (see Generalized Repunit Conjecture Ref). Assuming a base=1.618 (ratio of sequential terms), then the best fit coefficient is 0.60324 for the first 56 terms, which is already approaching Euler's constant 0.56145948. - Paul Bourdelais, Aug 23 2024

References

  • Clifford A. Pickover, Mazes for the Mind, St. Martin's Press, NY, 1992, p. 350.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 54.
  • Paulo Ribenboim, The Little Book of Big Primes, Springer-Verlag, NY, 1991, p. 178.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A046022.
Column k=1 of A303215.

Programs

  • Mathematica
    Select[Range[10^4], PrimeQ[Fibonacci[#]] &] (* Harvey P. Dale, Nov 20 2012 *)
    (* Start ~ 1.8x faster than the above *)
    Select[Range[10^4], PrimeQ[#] && PrimeQ[Fibonacci[#]] &] (* Eric W. Weisstein, Nov 07 2017 *)
    Select[Prime[Range[PrimePi[10^4]]], PrimeQ[Fibonacci[#]] &] (* Eric W. Weisstein, Nov 07 2017 *)
    (* End *)
  • PARI
    v=[3,4]; forprime(p=5,1e5, if(ispseudoprime(fibonacci(p)), v=concat(v,p))); v \\ Charles R Greathouse IV, Feb 14 2011
    
  • PARI
    is_A001605(n)={n==4 || isprime(n) & ispseudoprime(fibonacci(n))}  \\ M. F. Hasler, Sep 29 2012

Formula

Prime(i) = a(n) for some n <=> A080345(i) <= 1. - M. F. Hasler, Dec 12 2007

Extensions

Additional comments from Robert G. Wilson v, Aug 18 2000
More terms from David Broadhurst, Nov 08 2001
Two more terms (148091 and 201107) from T. D. Noe, Feb 12 2003 and Mar 04 2003
397379 from T. D. Noe, Aug 18 2003
433781, 590041, 593689 from Henri Lifchitz submitted by Ray Chandler, Feb 11 2005
604711 from Henri Lifchitz communicated by Eric W. Weisstein, Nov 29 2005
931517, 1049897, 1285607 found by Henri Lifchitz circa Nov 01 2008 and submitted by Alexander Adamchuk, Nov 28 2008
1636007 from Henri Lifchitz March 2009, communicated by Eric W. Weisstein, Apr 24 2009
1803059 and 1968721 from Henri Lifchitz, November 2009, submitted by Alex Ratushnyak, Aug 08 2012
a(49)=2904353 from Henri Lifchitz, Jul 15 2014
a(50)=3244369 from Henri Lifchitz, Nov 04 2017
a(51)=3340367 from Henri Lifchitz, Apr 25 2018
a(52)-a(56) from Ryan Propper added by Paul Bourdelais, Aug 23 2024

A161344 Numbers k with A033676(k)=2, where A033676 is the largest divisor <= sqrt(k).

Original entry on oeis.org

4, 6, 8, 10, 14, 22, 26, 34, 38, 46, 58, 62, 74, 82, 86, 94, 106, 118, 122, 134, 142, 146, 158, 166, 178, 194, 202, 206, 214, 218, 226, 254, 262, 274, 278, 298, 302, 314, 326, 334, 346, 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, 466, 478, 482, 502, 514
Offset: 1

Views

Author

Omar E. Pol, Jun 20 2009

Keywords

Comments

Define a sieve operation with parameter s that eliminates integers of the form s^2 + s*i (i >= 0) from the set A000027 of natural numbers. The sequence lists those natural numbers that are eliminated by the sieve s=2 and cannot be eliminated by any sieve s >= 3. - R. J. Mathar, Jun 24 2009
After a(3)=8 all terms are 2*prime; for n > 3, a(n) = 2*prime(n-1) = 2*A000040(n-1). - Zak Seidov, Jul 18 2009
From Omar E. Pol, Jul 18 2009: (Start)
A classification of the natural numbers A000027.
=============================================================
Numbers k whose largest divisor <= sqrt(k) equals j
=============================================================
j Sequence Comment
=============================================================
1 ..... A008578 1 together with the prime numbers
2 ..... A161344 This sequence
3 ..... A161345
4 ..... A161424
5 ..... A161835
6 ..... A162526
7 ..... A162527
8 ..... A162528
9 ..... A162529
10 .... A162530
11 .... A162531
12 .... A162532
... And so on. (End)
The numbers k whose largest divisor <= sqrt(k) is j are exactly those numbers j*m where m is either a prime >= k or one of the numbers in row j of A163925. - Franklin T. Adams-Watters, Aug 06 2009
See also A163280, the main entry for this sequence. - Omar E. Pol, Oct 24 2009
Also A100484 UNION 8. - Omar E. Pol, Nov 29 2012 (after Seidov and Hasler)
Is this the union of {4} and A073582? - R. J. Mathar, May 30 2025

Crossrefs

Second column of array in A163280. Also, second row of array in A163990.

Programs

  • Maple
    isA := proc(n,s) if n mod s <> 0 then RETURN(false); fi; if n/s-s >= 0 then RETURN(true); else RETURN(false); fi; end: isA161344 := proc(n) for s from 3 to n do if isA(n,s) then RETURN(false); fi; od: isA(n,2) ; end: for n from 1 to 3000 do if isA161344(n) then printf("%d,",n) ; fi; od; # R. J. Mathar, Jun 24 2009
  • Mathematica
    a[n_] := If[n <= 3, 2n+2, 2*Prime[n-1]]; Table[a[n], {n, 1, 56}] (* Jean-François Alcover, Nov 26 2012, after Zak Seidov *)
  • PARI
    a(n)=if(n>3,prime(n-1),n+1)*2 \\ M. F. Hasler, Nov 27 2012

Formula

Equals 2*A000040 union {8}. - M. F. Hasler, Nov 27 2012
a(n) = 2*A046022(n+1) = 2*A175787(n). - Omar E. Pol, Nov 27 2012

Extensions

More terms from R. J. Mathar, Jun 24 2009
Definition added by R. J. Mathar, Jun 28 2009

A379721 Numbers whose prime indices have sum <= product.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 30, 31, 33, 35, 37, 39, 41, 42, 43, 45, 47, 49, 50, 51, 53, 54, 55, 57, 59, 61, 63, 65, 66, 67, 69, 70, 71, 73, 75, 77, 78, 79, 81, 83, 84, 85, 87, 89, 90, 91, 93, 95, 97, 98, 99, 100, 101, 102, 103
Offset: 1

Views

Author

Gus Wiseman, Jan 05 2025

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Partitions of this type are counted by A319005.
The complement is A325038.

Examples

			The terms together with their prime indices begin:
    1: {}
    2: {1}
    3: {2}
    5: {3}
    7: {4}
    9: {2,2}
   11: {5}
   13: {6}
   15: {2,3}
   17: {7}
   19: {8}
   21: {2,4}
   23: {9}
   25: {3,3}
   27: {2,2,2}
   29: {10}
   30: {1,2,3}
		

Crossrefs

The case of equality is A301987, inequality A325037.
Nonpositive positions in A325036.
A000040 lists the primes, differences A001223.
A055396 gives least prime index, greatest A061395.
A056239 adds up prime indices, row sums of A112798, counted by A001222.
A379681 gives sum plus product of prime indices, firsts A379682.
Counting and ranking multisets by comparing sum and product:
- same: A001055 (strict A045778), ranks A301987
- divisible: A057567, ranks A326155
- divisor: A057568, ranks A326149, see A326156, A326172, A379733
- greater: A096276 shifted right, ranks A325038
- greater or equal: A096276, ranks A325044
- less: A114324, ranks A325037, see A318029
- less or equal: A319005, ranks A379721 (this)
- different: A379736, ranks A379722, see A111133

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],Total[prix[#]]<=Times@@prix[#]&]

Formula

Number k such that A056239(k) <= A003963(k).

A061006 a(n) = (n-1)! mod n.

Original entry on oeis.org

0, 1, 2, 2, 4, 0, 6, 0, 0, 0, 10, 0, 12, 0, 0, 0, 16, 0, 18, 0, 0, 0, 22, 0, 0, 0, 0, 0, 28, 0, 30, 0, 0, 0, 0, 0, 36, 0, 0, 0, 40, 0, 42, 0, 0, 0, 46, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 58, 0, 60, 0, 0, 0, 0, 0, 66, 0, 0, 0, 70, 0, 72, 0, 0, 0, 0, 0, 78, 0, 0, 0, 82, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Henry Bottomley, Apr 12 2001

Keywords

Comments

It appears that a(n) = (n!*h(n)) mod n, where h(n) = Sum_{k = 1..n} 1/k. - Gary Detlefs, Sep 04 2010
Indeed: It is easy to show n!*h(n) - (n-1)! = n*(n-1)!*h(n-1). Since (n-1)!*h(n-1) is integral, n!*h(n) == (n-1)! mod n. - Franz Vrabec, Apr 08 2017

Examples

			a(4) = 2 since (4-1)! = 6 = 2 mod 4.
a(5) = 4 since (5-1)! = 24 = 4 mod 5.
a(6) = 0 since (6-1)! = 120 = 0 mod 6.
		

Crossrefs

Positive for all but the first term of A046022. Cf. A000040, A000142, A061007, A061008, A061009.

Programs

Formula

a(4) = 2, a(p) = p - 1 for p prime (Wilson's_theorem), a(n) = 0 otherwise. Apart from n = 4, a(n) = (n-1)*A061007(n) = (n-1)*A010051(n).

A046021 Least inverse of the Kempner function A002034.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 7, 32, 27, 25, 11, 243, 13, 49, 125, 4096, 17, 2187, 19, 625, 343, 121, 23, 59049, 3125, 169, 177147, 2401, 29, 78125, 31, 134217728, 1331, 289, 16807, 43046721, 37, 361, 2197, 1953125, 41, 117649, 43, 14641, 9765625, 529, 47
Offset: 1

Views

Author

Keywords

Comments

To compute the n-th term for n > 1: For each prime p that divides n, find the highest power p^E(p) that divides (n-1)!. Then a(n) is the smallest of the numbers p^(E(p)+1). - Jonathan Sondow, Mar 03 2004
p^(E(p)+1) is smallest when p = P(n), the largest prime dividing n (since E(p) is approximately p^((n-1)/(p-1)), which decreases as p increases). So a(n) = P(n)^(E(P(n))+1) = A006530(n)^A102048(n) for n>1. - Jonathan Sondow, Dec 26 2004

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, "Factorial Factors" Sect. 4.4 in Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, pp. 111-115, 1994.

Crossrefs

Programs

  • Mathematica
    With[{p=First[Last[FactorInteger[n, FactorComplete->True]]]}, p^(1+Sum[Floor[(n-1)/p^k], {k, Floor[Log[n-1]/Log[p]]}])] (* Jonathan Sondow, Dec 26 2004 *)
  • PARI
    A046021(n,p=A006530(n))=p^A102048(n,p) \\ M. F. Hasler, Nov 27 2018
    
  • Python
    from sympy import primefactors, integer_log
    def A046021(n):
        if n == 1: return 1
        p = max(primefactors(n))
        return p**sum(((n-1)//p**k for k in range(1,integer_log(n-1,p)[0]+1)),start=1) # Chai Wah Wu, Oct 17 2024

Formula

a(n) = P^(1+Sum(k=1 to [log(n-1)/log(P)], [(n-1)/P^k])) for n>1, where P = A006530(n) is the largest prime dividing n. E.g. a(6) = 9 because 9 is the least integer m with A002034(m) = 6, that is, m divides 6!, but m does not divide k! for k < 6. - Jonathan Sondow, Dec 26 2004

Extensions

More terms from David W. Wilson and Christian G. Bower, independently.

A061007 a(n) = -(n-1)! mod n.

Original entry on oeis.org

0, 1, 1, 2, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0
Offset: 1

Views

Author

Henry Bottomley, Apr 12 2001

Keywords

Comments

The following sequences all appear to have the same parity (with an extra zero term at the start of A010051): A010051, A061007, A035026, A069754, A071574. - Jeremy Gardiner, Aug 09 2002
In particular, this is identical to the isprime function A010051 except for a(4) = 2 instead of 0. This is equivalent to Wilson's theorem, (n-1)! == -1 (mod n) iff n is prime. If n = p*q with p, q > 1, then p, q < n-1 and (n-1)! will contain the two factors p and q, unless p = q = 2 (if p = q > 2 then also 2p < n-1, so there are indeed two factors p in (n-1)!), whence (n-1)! == 0 (mod n). - M. F. Hasler, Jul 19 2024

Examples

			a(4) = 2 since -(4 - 1)! = -6 = 2 mod 4.
a(5) = 1 since -(5 - 1)! = -24 = 1 mod 5.
a(6) = 0 since -(6 - 1)! = -120 = 0 mod 6.
		

Crossrefs

Positive for all but the first term of A046022.
Cf. A000040 (the primes), A000142, A010051 (isprime function), A055976, A061006, A061008, A061009.

Programs

Formula

a(4) = 2, a(p) = 1 for p prime, a(n) = 0 otherwise. Apart from n = 4, a(n) = A010051(n) = A061006(n)/(n-1).

A105800 Greatest Fibonacci number that is a proper divisor of the n-th Fibonacci number; a(1) = a(2) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 3, 2, 5, 1, 8, 1, 13, 5, 21, 1, 34, 1, 55, 13, 89, 1, 144, 5, 233, 34, 377, 1, 610, 1, 987, 89, 1597, 13, 2584, 1, 4181, 233, 6765, 1, 10946, 1, 17711, 610, 28657, 1, 46368, 13, 75025, 1597, 121393, 1, 196418, 89, 317811, 4181, 514229, 1, 832040, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 20 2005

Keywords

Comments

a(A001605(n)) = 1.

Crossrefs

Cf. A046022 (gives the positions of ones).

Programs

  • Mathematica
    nn=70;Join[{1,1},With[{fibs=Fibonacci[Range[nn]]},Table[ Max[ Intersection[ Most[Divisors[fibs[[n]]]],fibs]],{n,3,nn}]]] (* Harvey P. Dale, Apr 10 2012 *)

Formula

From Antti Karttunen, Jan 11 2017: (Start)
a(n) = A280686(A000045(n)).
a(n) = A000045(A032742(n)). [Because A000045 is a divisibility sequence.]
a(A032742(n)) = A280688(n).
(End)

A175787 Primes together with 4.

Original entry on oeis.org

2, 3, 4, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277
Offset: 1

Views

Author

Michel Lagneau, Sep 04 2010

Keywords

Comments

sopf(n) is the sum of the distinct primes dividing n (A008472). Because sopf(n) = n if n is prime, this sequence is numbers n such that n^sopf(n) = sopf(n)^n.
Numbers n whose sum of prime factors is n. - Arkadiusz Wesolowski, Jan 17 2012
Numbers n such that 2n has exactly four divisors. - Wesley Ivan Hurt, Jul 01 2013
Numbers n such that n^2 does not divide n!. - Charles R Greathouse IV, Nov 04 2013

Crossrefs

Programs

  • Maple
    with(numtheory): digits:=200:nn:=200:for a from 1 to nn do: t1:=ifactors(a)[2]:t2:=sum(t1[i][1],i=1..nops(t1)) :if a^t2=t2^a then printf(`%d, `, a):else fi:od:
  • Mathematica
    Insert[Prime[Range[60]],4,3] (* Harvey P. Dale, Jan 26 2024 *)
  • PARI
    a(n)=if(n>3,prime(n-1),n+1) \\ Charles R Greathouse IV, Aug 26 2011

Formula

a(n) = A046022(n+1). - Omar E. Pol, Nov 27 2012

Extensions

Switched comment and name. Charles R Greathouse IV, Nov 04 2013

A018194 Number of steps for S(S(..S(n)..)) to converge, where S is the Kempner function A002034.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 1, 2, 3, 2, 4, 2, 1, 2, 1, 3, 2, 2, 2, 3, 1, 2, 2, 2, 1, 2, 1, 2, 3, 2, 1, 3, 3, 3, 2, 2, 1, 4, 2, 2, 2, 2, 1, 2, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 1, 3, 1, 2, 3, 2, 2, 2, 1, 3, 4, 2, 1, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 3, 1, 3, 2, 3, 1, 2, 1, 2, 2, 2, 1, 4
Offset: 1

Views

Author

Henry Ibstedt (Glimminge 2036, 28060 Broby, Sweden)

Keywords

References

  • Henry Ibstedt, "Smarandache Iterations", Smarandache Notions Journal, (submitted), 1996.

Crossrefs

Programs

  • Haskell
    a018194 n = 1 + length (takeWhile (/= 0) $ zipWith (-) ks $ tail ks)
       where ks = iterate a002034 n
    -- Reinhard Zumkeller, Mar 09 2012

Formula

a(A046022(n)) = 1. [Reinhard Zumkeller, Mar 09 2012]

Extensions

Corrected and extended by David W. Wilson, May 15 1997
Showing 1-10 of 34 results. Next