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 14 results. Next

A305791 Dirichlet convolution of A175851 with itself.

Original entry on oeis.org

1, 2, 2, 5, 2, 6, 2, 8, 7, 10, 2, 12, 2, 6, 8, 16, 2, 14, 2, 16, 8, 10, 2, 20, 7, 10, 16, 20, 2, 22, 2, 20, 8, 10, 12, 36, 2, 6, 8, 32, 2, 18, 2, 16, 18, 10, 2, 32, 7, 22, 12, 24, 2, 30, 8, 32, 12, 14, 2, 44, 2, 6, 18, 32, 12, 30, 2, 16, 8, 30, 2, 48, 2, 6, 18, 16, 12, 30, 2, 44, 25, 10, 2, 44, 8, 10, 12, 36, 2, 54, 8, 20, 12, 14, 16, 56, 2
Offset: 1

Views

Author

Antti Karttunen, Jun 13 2018

Keywords

Crossrefs

Programs

Formula

a(n) = Sum_{d|n} A175851(d)*A175851(n/d).

A317830 Numerators of rational valued sequence whose Dirichlet convolution with itself yields A175851, the ordinal transform of the nextprime function, A151800.

Original entry on oeis.org

1, 1, 1, 7, 1, 3, 1, 9, 11, 7, 1, 3, 1, 3, 5, 171, 1, -1, 1, -5, 5, 7, 1, -1, 11, 7, 29, 35, 1, -7, 1, -41, 5, 7, 9, 93, 1, 3, 5, 11, 1, -3, 1, -5, 3, 7, 1, -61, 11, 7, 9, 27, 1, -29, 5, -1, 9, 11, 1, -29, 1, 3, 3, 771, 9, 9, 1, -5, 5, -3, 1, -73, 1, 3, 3, 19, 9, 9, 1, -141, -45, 7, 1, -53, 5, 7, 9, 43, 1, -63, 5, 11, 9, 11, 13, 1597, 1
Offset: 1

Views

Author

Antti Karttunen, Aug 12 2018

Keywords

Crossrefs

Cf. A151800, A175851, A046644 (denominators).

Programs

  • Mathematica
    A175851[n_] := If[!CompositeQ[n], 1, n - NextPrime[n, -1] + 1];
    f[n_] := f[n] = If[n == 1, 1, (1/2)(A175851[n] - Sum[If[1 < d < n, f[d]* f[n/d], 0], {d, Divisors[n]}])];
    a[n_] := Numerator[f[n]];
    Array[a, 100] (* Jean-François Alcover, Dec 19 2021 *)
  • PARI
    A175851(n) = if(1==n,n,1 + n - precprime(n));
    A317830aux(n) = if(1==n,n,(A175851(n)-sumdiv(n,d,if((d>1)&&(dA317830aux(d)*A317830aux(n/d),0)))/2);
    A317830(n) = numerator(A317830aux(n));
    
  • PARI
    \\ Memoized implementation:
    memo317830 = Map();
    A317830aux(n) = if(1==n,n,if(mapisdefined(memo317830,n),mapget(memo317830,n),my(v = (A175851(n)-sumdiv(n,d,if((d>1)&&(dA317830aux(d)*A317830aux(n/d),0)))/2); mapput(memo317830,n,v); (v)));

Formula

a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A175851(n) - Sum_{d|n, d>1, d 1.

A305805 Dirichlet inverse of A175851.

Original entry on oeis.org

1, -1, -1, -1, -1, 0, -1, 1, -2, -2, -1, 3, -1, 0, -1, -1, -1, 5, -1, 7, -1, -2, -1, 0, -2, -2, 0, -1, -1, 10, -1, 3, -1, -2, -3, -3, -1, 0, -1, 0, -1, 6, -1, 7, 6, -2, -1, -1, -2, 7, -3, 3, -1, 4, -1, 6, -3, -4, -1, -7, -1, 0, 6, -1, -3, 6, -1, 7, -1, 12, -1, -4, -1, 0, 6, 1, -3, 6, -1, -5, 8, -2, -1, 5, -1, -2, -3, -2, -1, 0, -1, 5
Offset: 1

Views

Author

Antti Karttunen, Jun 13 2018

Keywords

Crossrefs

Programs

  • Mathematica
    b[n_] := If[n < 3, 1, n - NextPrime[n + 1, -1] + 1];
    a[n_] := a[n] = If[n == 1, 1, -Sum[b[n/d] a[d], {d, Most@Divisors[n]}]];
    Array[a, 100] (* Jean-François Alcover, Feb 17 2020 *)
  • PARI
    A175851(n) = if(1==n,n,1 + n - precprime(n));
    A305805(n) = if(1==n,1,-sumdiv(n,d,if(dA175851(n/d)*A305805(d),0)));

Formula

a(1) = 1; for n > 1, a(n) = -Sum_{d|n, dA175851(n/d)*a(d).

A305806 Möbius transform of A175851.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 0, 0, 2, 3, 0, -1, 0, 1, 2, 2, 0, -2, 0, -3, 2, 3, 0, 0, 2, 3, 2, 3, 0, -5, 0, -2, 2, 3, 4, 4, 0, 1, 2, 2, 0, -3, 0, -3, -2, 3, 0, -2, 2, -2, 4, 1, 0, -2, 2, -2, 4, 5, 0, 3, 0, 1, -2, 2, 4, -1, 0, -3, 2, -5, 0, -4, 0, 1, -2, 1, 4, -1, 0, -4, -2, 3, 0, -3, 2, 3, 4, 4, 0, 2, 2, -1, 4, 5, 6, 8, 0, -2, -2, 2, 0, -7, 0, -4, -6
Offset: 1

Views

Author

Antti Karttunen, Jun 13 2018

Keywords

Crossrefs

Programs

Formula

a(n) = Sum_{d|n} A008683(n/d)*A175851(d).

A304106 Ordinal transform of A175851.

Original entry on oeis.org

1, 2, 3, 1, 4, 2, 5, 3, 1, 1, 6, 4, 7, 5, 2, 2, 8, 6, 9, 7, 3, 3, 10, 8, 4, 4, 1, 1, 11, 9, 12, 10, 5, 5, 2, 2, 13, 11, 6, 6, 14, 12, 15, 13, 7, 7, 16, 14, 8, 8, 3, 3, 17, 15, 9, 9, 4, 4, 18, 16, 19, 17, 10, 10, 5, 5, 20, 18, 11, 11, 21, 19, 22, 20, 12, 12, 6, 6, 23, 21, 13, 13, 24, 22, 14, 14, 7, 7, 25, 23, 15, 15, 8, 8, 1, 1, 26, 24, 16, 16
Offset: 1

Views

Author

Antti Karttunen, Jun 09 2018

Keywords

Comments

Ordinal transform of the ordinal transform of the nextprime function, A151800(1..) = 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, ...

Crossrefs

Programs

  • Mathematica
    A175851[n_] := If[!CompositeQ[n], 1, n - NextPrime[n, -1] + 1];
    b[_] = 0;
    a[n_] := a[n] = With[{t = A175851[n]}, b[t] = b[t] + 1];
    Array[a, 105] (* Jean-François Alcover, Dec 21 2021 *)
  • PARI
    up_to = 65537;
    A151800(n) = nextprime(1+n);
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    v304106 = ordinal_transform(ordinal_transform(vector(up_to,n,A151800(n))));
    A304106(n) = v304106[n];

Formula

For all n >= 1, a(A008578(n)) = n.

A007917 Version 1 of the "previous prime" function: largest prime <= n.

Original entry on oeis.org

2, 3, 3, 5, 5, 7, 7, 7, 7, 11, 11, 13, 13, 13, 13, 17, 17, 19, 19, 19, 19, 23, 23, 23, 23, 23, 23, 29, 29, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 41, 41, 43, 43, 43, 43, 47, 47, 47, 47, 47, 47, 53, 53, 53, 53, 53, 53, 59, 59, 61, 61, 61, 61, 61, 61, 67, 67, 67, 67, 71, 71, 73, 73, 73, 73
Offset: 2

Views

Author

R. Muller

Keywords

Comments

Version 2 of the "previous prime" function (see A151799) is "largest prime < n". This produces the same sequence of numerical values, except the offset (or indexing) starts at 3 instead of 2.
Maple's "prevprime" function uses version 2.
Also the largest prime dividing n! or lcm(1,...,n). - Labos Elemer, Jun 22 2000
Also largest prime among terms of (n+1)st row of Pascal's triangle. - Jud McCranie, Jan 17 2000
Also largest integer k such that A000203(k) <= n+1. - Benoit Cloitre, Mar 17 2002. - Corrected by Antti Karttunen, Nov 07 2017
Also largest prime factor of A061355(n) (denominator of Sum_{k=0..n} 1/k!). - Jonathan Sondow, Jan 09 2005
Also prime(pi(x)) where pi(x) is the prime counting function = number of primes <= x. - Cino Hilliard, May 03 2005
Also largest prime factor, occurring to the power p, in denominator of Sum_{k=1..n} 1/k^p, for any positive integer p. - M. F. Hasler, Nov 10 2006
For n > 10, these values are close to the most negative eigenvalues of A191898 (conjecture). - Mats Granvik, Nov 04 2011

References

  • K. Atanassov, On the 37th and the 38th Smarandache Problems, Notes on Number Theory and Discrete Mathematics, Sophia, Bulgaria, Vol. 5 (1999), No. 2, 83-85.
  • J. Castillo, Other Smarandache Type Functions: Inferior/Superior Smarandache f-part of x, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 202-204.

Crossrefs

Programs

Formula

Equals A006530(A000142(n)). - Jonathan Sondow, Jan 09 2005
Equals A006530(A056040(n)). - Peter Luschny, Mar 04 2011
a(n) = A000040(A049084(A007918(n)) + 1 - A010051(n)). - Reinhard Zumkeller, Jul 26 2012
From Wesley Ivan Hurt, May 22 2013: (Start)
omega( Product_{i=2..n} a(i) ) = pi(n).
Omega( Product_{i=2..n} a(i) ) = n - 1. (End)
For n >= 2, a(A000203(n)) = A070801(n). - Antti Karttunen, Nov 07 2017
a(n) = n + 1 - Sum_{i=1..n} floor(pi(i)/pi(n)) = n + 1 - A175851(n). - Ridouane Oudra, Jun 24 2024
Conjecture: a(n) = floor(log(Sum_{k=2..n} exp(A000010(k)+1))). - Joseph M. Shunia, Aug 09 2024
a(n) = A000040(A000720(n)). - Ridouane Oudra, Oct 04 2024

Extensions

Edited by N. J. A. Sloane, Apr 06 2008

A046644 From square root of Riemann zeta function: form Dirichlet series Sum b_n/n^s whose square is zeta function; sequence gives denominator of b_n.

Original entry on oeis.org

1, 2, 2, 8, 2, 4, 2, 16, 8, 4, 2, 16, 2, 4, 4, 128, 2, 16, 2, 16, 4, 4, 2, 32, 8, 4, 16, 16, 2, 8, 2, 256, 4, 4, 4, 64, 2, 4, 4, 32, 2, 8, 2, 16, 16, 4, 2, 256, 8, 16, 4, 16, 2, 32, 4, 32, 4, 4, 2, 32, 2, 4, 16, 1024, 4, 8, 2, 16, 4, 8, 2, 128, 2, 4, 16, 16, 4, 8
Offset: 1

Views

Author

Keywords

Comments

From Antti Karttunen, Aug 21 2018: (Start)
a(n) is the denominator of any rational-valued sequence f(n) which has been defined as f(n) = (1/2) * (b(n) - Sum_{d|n, d>1, d
Proof:
Proof is by induction. We assume as our induction hypothesis that the given multiplicative formula for A046644 (resp. additive formula for A046645) holds for all proper divisors d|n, dA046645(p) = 1. [Remark: for squares of primes, f(p^2) = (4*b(p^2) - 1)/8, thus a(p^2) = 8.]
First we note that A005187(x+y) <= A005187(x) + A005187(y), with equivalence attained only when A004198(x,y) = 0, that is, when x and y do not have any 1-bits in the shared positions. Let m = Sum_{e} A005187(e), with e ranging over the exponents in prime factorization of n.
For [case A] any n in A268388 it happens that only when d (and thus also n/d) are infinitary divisors of n will Sum_{e} A005187(e) [where e now ranges over the union of multisets of exponents in the prime factorizations of d and n/d] attain value m, which is the maximum possible for such sums computed for all divisor pairs d and n/d. For any n in A268388, A037445(n) = 2^k, k >= 2, thus A037445(n) - 2 = 2 mod 4 (excluding 1 and n from the count, thus -2). Thus, in the recursive formula above, the maximal denominator that occurs in the sum is 2^m which occurs k times, with k being an even number, but not a multiple of 4, thus the factor (1/2) in the front of the whole sum will ensure that the denominator of the whole expression is 2^m [which thus is equal to 2^A046645(n) = a(n)].
On the other hand [case B], for squares in A050376 (A082522, numbers of the form p^(2^k) with p prime and k>0), all the sums A005187(x)+A005187(y), where x+y = 2^k, 0 < x <= y < 2^k are less than A005187(2^k), thus it is the lonely "middle pair" f(p^(2^(k-1))) * f(p^(2^(k-1))) among all the pairs f(d)*f(n/d), 1 < d < n = p^(2^k) which yields the maximal denominator. Furthermore, as it occurs an odd number of times (only once), the common factor (1/2) for the whole sum will increase the exponent of 2 in denominator by one, which will be (2*A005187(2^(k-1))) + 1 = A005187(2^k) = A046645(p^(2^k)).
(End)
From Antti Karttunen, Aug 21 2018: (Start)
The following list gives a few such pairs num(n), b(n) for which b(n) is Dirichlet convolution of num(n)/a(n). Here ε stands for sequence A063524 (1, 0, 0, ...).
Numerators Dirichlet convolution of numerator(n)/a(n) yields
------- -----------
(End)
This sequence gives an upper bound for the denominators of any rational-valued sequence obtained as the "Dirichlet Square Root" of any integer-valued sequence. - Andrew Howroyd, Aug 23 2018

Crossrefs

See A046643 for more details. See also A046645, A317940.
Cf. A299150, A299152, A317832, A317926, A317932, A317934 (for denominator sequences of other similar constructions).

Programs

Formula

From Antti Karttunen, Jul 08 2017: (Start)
Multiplicative with a(p^n) = 2^A005187(n).
a(1) = 1; for n > 1, a(n) = A000079(A005187(A067029(n))) * a(A028234(n)).
a(n) = A000079(A046645(n)).
(End)
Sum_{j=1..n} A046643(j)/A046644(j) ~ n / sqrt(Pi*log(n)) * (1 + (1 - gamma/2)/(2*log(n))), where gamma is the Euler-Mascheroni constant A001620. - Vaclav Kotesovec, May 04 2025

A049711 a(n) = n - prevprime(n).

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6
Offset: 3

Keywords

Comments

All runs end in even numbers at a(p), new highs are found at A000101 and the increasing gap size is A005250. - Robert G. Wilson v, Dec 07 2001
All terms are positive since here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015

Programs

  • Maple
    A049711 := n-> n-prevprime(n);
  • Mathematica
    PrevPrim[n_] := Block[ {k = n - 1}, While[ !PrimeQ[k], k-- ]; Return[k]]; Table[ n - PrevPrim[n], {n, 3, 100} ]
    Array[#-NextPrime[#,-1]&,100,3] (* Harvey P. Dale, Dec 07 2011 *)
  • PARI
    A049711(n)=n-precprime(n-1) \\ M. F. Hasler, Sep 09 2015

Formula

a(n) = A064722(n-1) + 1. - Pontus von Brömssen, Jul 31 2022

A276781 a(n) = 1+n-(nearest power of prime <= n); for n > 1, a(n) = minimal b such that the numbers binomial(n,k) for b <= k <= n-b have a common divisor greater than 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 3, 4, 5, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 1, 2, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 1, 2
Offset: 1

Author

N. J. A. Sloane, Sep 29 2016, following a suggestion from Eric Desbiaux

Keywords

Comments

The definition in the video has "b < k < n-b" rather than "b <= k <= n-b", but that appears to be a typographical error.
From Antti Karttunen, Jan 21 2020: (Start)
a(n) = 1 if n is a power of prime (term of A000961), otherwise a(n) is one more than the distance to the nearest preceding prime power.
For n > 1, a(n) indicates the maximum region on the row n of Pascal's triangle (A007318) such that binomial terms C(n,a(n)) .. C(n,n-a(n)) all share a common prime factor. Because for all prime powers, p^k, the binomial terms C(p^k,1) .. C(p^k,p^k-1) have p as their prime factor, we have a(A000961(n)) = 1 for all n, while for each successive n that is not a prime power, the region of shared prime factor shrinks one step more towards the center of the triangle. From this follows that this is the ordinal transform of A025528 (equally, of A065515, or of A003418(n) from n >= 1 onward), equivalent to the simple definition given above.
(End)

Examples

			Row 6 of Pascal's triangle is 1,6,15,20,15,6,1 and [15,20,15] have a common divisor of 5. Since 15 = binomial(6,2), a(6)=2.
		

Crossrefs

Cf. A007318, A010055, A276782 (positions of records), A000961 (positions of ones), A024619 (positions of terms > 1).

Programs

  • Maple
    mygcd:=proc(lis) local i,g,m;
    m:=nops(lis); g:=lis[1];
    for i from 2 to m do g:=gcd(g,lis[i]); od:
    g; end;
    f:=proc(n) local b,lis; global mygcd;
    for b from floor(n/2) by -1 to 1 do
    lis:=[seq(binomial(n,i),i=b..n-b)];
    if mygcd(lis)=1 then break; fi; od:
    b+1;
    end;
    [seq(f(n),n=2..120)];
  • Mathematica
    Table[b = 1; While[GCD @@ Map[Binomial[n, #] &, Range[b, n - b]] == 1, b++]; b, {n, 92}] (* Michael De Vlieger, Oct 03 2016 *)
  • PARI
    A276781(n) = if(1==n,1,forstep(k=n,1,-1,if(isprimepower(k),return(1+n-k)))); \\ Antti Karttunen, Jan 21 2020
    
  • Python
    from sympy import factorint
    def A276781(n): return 1+n-next(filter(lambda m:len(factorint(m))<=1, range(n,0,-1))) # Chai Wah Wu, Oct 25 2024

Formula

If A010055(n) == 1, a(n) = 1, otherwise a(n) = 1 + a(n-1). - Antti Karttunen, Jan 21 2020

Extensions

Term a(1) = 1 prepended and alternative simpler definition added to the name by Antti Karttunen, Jan 20 2020

A093521 Runs of 1's of lengths 1, prime(1), prime(2), prime(3), ... separated by 0's.

Original entry on oeis.org

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

Author

Robert G. Wilson v, Mar 29 2004

Keywords

Comments

Carl Sagan's "Contact" sequence.
Zeros occur at positions given by 1+A110895(k). - Antti Karttunen, Nov 08 2018

References

  • W. A. Dembski and J. M. Kushiner, Signs of Intelligence, Baker Book House Co., Grand Rapids, MI, p30-31, 2001,
  • Carl Sagan, Contact, Simon and Schuster, Chapter 4 "Prime Numbers," pp. 68-82, NY, 1985.

Programs

  • Mathematica
    a = Table[1, {100}]; Do[ a[[Sum[Prime[i], {i, n}] + n]] = 0, {n, 1, 8}]; a
  • PARI
    up_to = 111;
    A093521list(up_to) = { my(v=vector(up_to), i=2, j); v[1] = 1; v[2] = 0; forprime(p=2, oo, j=p; while(j, if(i==up_to, return(v), i++; v[i] = 1; j--)); if(i==up_to, return(v), i++; v[i] = 0)); };
    v093521 = A093521list(up_to);
    A093521(n) = v093521[n];

Extensions

Data section extended up to n=111 by Antti Karttunen, Nov 08 2018
Showing 1-10 of 14 results. Next