login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A089026 a(n) = n if n is a prime, otherwise a(n) = 1. 13
1, 2, 3, 1, 5, 1, 7, 1, 1, 1, 11, 1, 13, 1, 1, 1, 17, 1, 19, 1, 1, 1, 23, 1, 1, 1, 1, 1, 29, 1, 31, 1, 1, 1, 1, 1, 37, 1, 1, 1, 41, 1, 43, 1, 1, 1, 47, 1, 1, 1, 1, 1, 53, 1, 1, 1, 1, 1, 59, 1, 61, 1, 1, 1, 1, 1, 67, 1, 1, 1, 71, 1, 73, 1, 1, 1, 1, 1, 79, 1, 1, 1, 83, 1, 1, 1, 1, 1, 89, 1, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

REFERENCES

Paulo Ribenboim, The little book of big primes, Springer 1991, p. 106.

L. Tesler, "Factorials and Primes", Math. Bulletin of the Bronx H.S. of Science (1961), 5-10. [From Larry Tesler (tesler(AT)pobox.com), Nov 08 2010]

LINKS

G. C. Greubel, Table of n, a(n) for n = 1..5000

FORMULA

There are two other expressions for this sequence, which in Maple language are as follows: b1 := proc(n) add((-1)^m*m!*stirling2(n+1, m+1)/(m+1), m=0..n) end; b0 := proc(n) add((-1)^m*m!*stirling2(n, m)/(m+1), m=0..n) end; seq(denom(n!*b1(n)), n=0..99); -> A089026; and also seq(denom(n!*b0(n)), n=0..99); -> A089026. - Peter Luschny, Nov 29 2003

From Alexander Adamchuk, May 20 2006: (Start)

a(n) = numerator((n/2)/(n-1)!) + floor(2/n) - 2*floor(1/n).

a(n) = A090585(n-1) = A000217(n-1)/A069268(n-1) for n>2. (End)

a(n) = gcd(n,(n-1)!+1). - Jaume Oliver Lafont, Jul 17 2008, Jan 23 2009

a(n) = n*((n-1)!^2 mod n)+(((n+1)-(n-1)!^2) mod n)+(C(2*(n-1),n-1) mod 2), with n>=1. - Paolo P. Lava, Feb 17 2009

a(1) = 1, a(2) = 2, then a(n) = 1 or a(n) = n = prime(m) = (Product q+k, k = 1 ... 2*floor(n/2+1)-q) / (Product prime(i)^(Sum (floor((n+1)/(prime(i)^w)) - floor(q/(prime(i)^w)) ), w = 1 ... floor(log[base prime(i)] n+1) ), i = 2 ... m-1) where q = prime(m-1). -  Larry Tesler (tesler(AT)pobox.com), Nov 08 2010

a(n) = (n!*HarmonicNumber(n) mod n)+1, n != 4. - Gary Detlefs, Dec 03 2011

a(n) = denominator of (n!)/n^(3/2). - Arkadiusz Wesolowski, Dec 04 2011

a(n) = A034386(n+1)/A034386(n). - Eric Desbiaux, May 10 2013

a(n) = n^A010051(n). - Wesley Ivan Hurt, Jun 16 2013

a(n) = A014963(n)^(-A008683(n)). - Mats Granvik, Jul 02 2016

EXAMPLE

From Larry Tesler (tesler(AT)pobox.com), Nov 08 2010: (Start)

a(9) = (8*9*10)/(2^((5+2+1)-(3+1+0))*3^((3+1)-(2+0))*5^((2)-(1))*7^((1)-(1))) = 1 [composite].

a(10) = (8*9*10)/(2^((5+2+1)-(3+1+0))*3^((3+1)-(2+0))*5^((2)-(1))*7^((1)-(1))) = 1 [composite].

a(11) = (8*9*10*11*12)/(2^((6+3+1)-(3+1+0))*3^((4+1)-(2+0))*5^((2)-(1))*7^((1)-(1))) = 11 [prime]. (End)

MATHEMATICA

digits=200; a=Table[If[PrimePi[n]-PrimePi[n-1]>0, n, 1], {n, 1, digits}]; Table[Numerator[(n/2)/(n-1)! ] + Floor[2/n] - 2*Floor[1/n], {n, 1, 200}] (* Alexander Adamchuk, May 20 2006 *)

Range@ 120 /. k_ /; CompositeQ@ k -> 1 (* or *)

Table[n Boole@ PrimeQ@ n, {n, 120}] /. 0 -> 1 (* or *)

Table[If[PrimeQ@ n, n, 1], {n, 120}] (* Michael De Vlieger, Jul 02 2016 *)

PROG

(Sage)

def A089026(n):

    if n == 4: return 1

    f = factorial(n-1)

    return (f + 1) - n*(f//n)

[A089026(n) for n in (1..96)]   # Peter Luschny, Oct 16 2013

CROSSREFS

Differs from A080305 at n=30.

Cf. A090585, A000217, A069268, A090586, A007619, A135683.

Sequence in context: A139764 A227643 A249386 * A080305 A220137 A053815

Adjacent sequences:  A089023 A089024 A089025 * A089027 A089028 A089029

KEYWORD

nonn,changed

AUTHOR

Roger L. Bagula, Nov 12 2003

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified November 18 19:06 EST 2017. Contains 294894 sequences.