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.

Previous Showing 21-30 of 38 results. Next

A260571 Numbers n such that (n^83+1)/(n+1) is prime.

Original entry on oeis.org

49, 75, 458, 471, 634, 734, 798, 809, 932, 1139, 1268, 1400, 1498, 1963, 1989, 2112, 2177, 2233, 2252, 2349, 2365, 2446, 2729, 2841, 2861, 2887, 3013, 3048, 3239, 3262, 3403, 3464, 3703, 3855, 3883, 4534, 5147, 5189, 5523, 5611, 5778, 6041, 6200, 6336, 6682, 7068
Offset: 1

Views

Author

Tim Johannes Ohrtmann, Jul 29 2015

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..10000] |IsPrime((n^83 + 1) div (n + 1))]
  • Mathematica
    Select[Range[1, 10000], PrimeQ[(#^83 + 1)/(# + 1)] &]
  • PARI
    for(n=1,10000, if(isprime((n^83+1)/(n+1)), print1(n,", ")))
    

A260572 Numbers n such that (n^89+1)/(n+1) is prime.

Original entry on oeis.org

16, 20, 93, 195, 227, 325, 465, 758, 888, 911, 1075, 1301, 1590, 1640, 1783, 1807, 2168, 2204, 2231, 2376, 2528, 2591, 2627, 2648, 2909, 2959, 3063, 3109, 3650, 3688, 3709, 3784, 3910, 3943, 4132, 4162, 4385, 4417, 4443, 4613, 5183, 5465, 5574, 5750, 5854, 5975
Offset: 1

Views

Author

Tim Johannes Ohrtmann, Jul 29 2015

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..10000] |IsPrime((n^89 + 1) div (n + 1))]
  • Mathematica
    Select[Range[1, 10000], PrimeQ[(#^89 + 1)/(# + 1)] &]
  • PARI
    for(n=1,10000, if(isprime((n^89+1)/(n+1)), print1(n,", ")))
    

A379749 a(n) is the first prime that has digit sum n in base n and n+1 in base n+1.

Original entry on oeis.org

5, 7, 13, 41, 31, 43, 113, 73, 181, 331, 397, 157, 547, 211, 241, 1361, 307, 2053, 761, 421, 463, 1013, 1657, 601, 1301, 3511, 757, 2437, 1741, 1861, 5953, 2113, 1123, 2381, 2521, 6661, 4219, 1483, 3121, 13121, 1723, 3613, 9461, 9901, 6211, 12973, 4513, 7057, 7351, 2551, 15913, 8269, 25759, 2971
Offset: 2

Views

Author

Robert Israel, Jan 01 2025

Keywords

Comments

For n >= 3, the least number with digit sum n in base n and n+1 in base n+1 is A002061(n) = n^2 - n + 1. This is prime for n in A055494. Thus (if it exists) a(n) >= A002061(n), with equality for n in A055494.

Examples

			For n = 8, a(8) = 113 because 113 is prime, 113 = 161_8 = 135_9 has digit sums 8 in base 8 and 9 in base 9, and no smaller prime works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,v,x;
      for k from 1 do
        v:= convert(convert(k,base,n),`+`);
        if v <= n then
          x:= k*n + n-v;
          if convert(convert(x,base,n+1),`+`) = n+1 and isprime(x) then return x fi
        fi
      od;
    end proc:
    map(f, [$2 .. 100]);
  • Mathematica
    a[n_]:=Module[{k=1}, While[DigitSum[Prime[k],n]!=n || DigitSum[Prime[k],n+1]!=n+1, k++]; Prime[k]]; Array[a,54,2] (* Stefano Spezia, Jan 01 2025 *)
  • PARI
    a(n) = my(p=2); while ((sumdigits(p, n) != n) || (sumdigits(p, n+1) != n+1), p=nextprime(p+1)); p; \\ Michel Marcus, Jan 02 2025
    
  • Python
    from sympy import isprime
    from sympy.ntheory import digits
    def nextsod(n, base):
        c, b, w = 0, base, 0
        while True:
            d = n%b
            if d+1 < b and c:
                return (n+1)*b**w + ((c-1)%(b-1)+1)*b**((c-1)//(b-1))-1
            c += d; n //= b; w += 1
    def A226636gen(sod=3, base=3): # generator of terms for any sod, base
        an = (sod%(base-1)+1)*base**(sod//(base-1))-1
        while True: yield an; an = nextsod(an, base)
    def a(n):
        for k in A226636gen(sod=n, base=n):
            if sum(digits(k, n+1)[1:]) == n+1 and isprime(k):
                return k
    print([a(n) for n in range(2, 56)]) # Michael S. Branicky, Jan 04 2025

A108809 Numbers n such that both n+(n-1)^2 and n+(n+1)^2 are primes.

Original entry on oeis.org

2, 3, 4, 7, 9, 15, 18, 25, 34, 55, 58, 63, 67, 100, 102, 139, 144, 148, 154, 162, 163, 168, 190, 195, 219, 232, 247, 267, 280, 289, 330, 349, 379, 384, 417, 427, 448, 454, 477, 568, 580, 643, 645, 669, 672, 727, 762, 793, 802, 813, 837, 847, 900, 975, 988, 993
Offset: 1

Views

Author

Walter Kehowski, Jul 04 2005

Keywords

Examples

			34 is in the sequence because 34 + 33^2 = 1123 and 34 + 35^2 = 1259 are both prime.
		

Crossrefs

Cf. A027861.
Intersection of A055494 and A094210. - Michel Marcus, Feb 08 2017

Programs

  • Maple
    L:=[]; for k from 1 to 1000 do if isprime(k+(k-1)^2) and isprime(k+(k+1)^2) then L:=[op(L),k] fi od;
  • Mathematica
    Select[Range@1000, PrimeQ[#^2 - # + 1] && PrimeQ[#^2 + 3 # + 1] &] (* Ivan Neretin, Feb 08 2017 *)
  • PARI
    isok(n) = isprime(n+(n-1)^2) && isprime(n+(n+1)^2); \\ Michel Marcus, Feb 08 2017

A193351 Numbers k such that A071324(k) is prime.

Original entry on oeis.org

3, 4, 8, 9, 16, 18, 49, 50, 64, 81, 169, 225, 288, 324, 392, 578, 625, 729, 882, 900, 1024, 1458, 1568, 1936, 2304, 2450, 2592, 3042, 3136, 3200, 3362, 3600, 4096, 4489, 4802, 4900, 5000, 6241, 6272, 6400, 6962, 7744, 7938, 8100, 10082, 11025, 11552, 12996
Offset: 1

Views

Author

Michel Lagneau, Dec 20 2012

Keywords

Comments

Numbers k such that the alternating sum of all divisors of k (divisors nonincreasing, starting with k) is prime.
The corresponding primes are 2, 3, 5, 7, 11, 13, 43, 31, 43, 61, 157, ...
It is interesting to note that all numbers except the first are squares, or twice a square, hence the conjecture:
For k > 3, if the alternating sum of all divisors of k (divisors nonincreasing, starting with k) is a prime number, then k is either a square or twice a square.
This conjecture is verified up to k <= 10^8. - Shreyansh Jaiswal, Apr 25 2025
Nevertheless, the difficulty is only for the even numbers. The odd numbers k are necessarily square because the number of divisors of an integer j is odd if and only if j is a square => the alternate sum of the odd divisors is odd.
For large k, the asymptotic law of the ratio r = (number of squares) / (number of twice squares) seems to be r ~ 1. For example, for k < 10^6 we obtain 213 primes corresponding to 118 squares and 95 twice squares.
Similar considerations such as those discussed for the odd squares also exist for the sequence A023194 (numbers k such that sigma(k) is prime). All numbers k except the first are squares, and each number of this sequence is a prime power => sigma(k) is odd.
From Shreyansh Jaiswal, Apr 19 2025: (Start)
For k < 10^6, the ratio r is 118/95, approximately 1.24. For k <= 10^8, there are 815 perfect squares and 546 twice squares. This gives r = 815/546, which is approximately 1.49. This computational data does not hint that r ~ 1.
Interestingly, out of the first 400 terms, 245 terms can be represented as a sum of two distinct positive integer squares.
Another interesting aspect is terms of the form 10^n. For 1 <= n <= 500, only n = 8 (corresponding to 10^8) is a term in the sequence. It appears that terms of the form 10^n are quite uncommon. (End)

Examples

			169 is in the sequence because the divisors of 169 are 1, 13, 169 and 169 - 13 + 1 = 157 is prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 20000 do:x:=divisors(n):n1:=nops(x):s:=0: s:=sum('((-1)^(i+1))*x[n1-i+1]', 'i'=1..n1): if type(s,prime)=true then printf(`%d, `,n):else fi:od:
  • Mathematica
    Select[Range[13000],PrimeQ[Total[Times@@@Partition[Riffle[ Reverse[ Divisors[ #]],{1,-1},{2,-1,2}],2]]]&] (* Harvey P. Dale, Feb 04 2015 *)
  • Python
    from sympy import *; from functools import lru_cache
    cached_divisors = lru_cache()(divisors)
    def A071324(n):  return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n))))
    for n in range(1,13001):
        if isprime(A071324(n)):
            print(n, end=", ") # Shreyansh Jaiswal, Apr 17 2025

A212738 a(n) = (7^p - 6^p - 1)/(1806p) where p is the n-th prime.

Original entry on oeis.org

1, 43, 81271, 3570505, 7025726485, 314435374639, 639872336584027, 60775577624897675065, 2794429652350970000851, 276858360603194024261113585, 600808083611945729624598396925, 28083738921571587634894783049047, 61728002094732427074308383210511683
Offset: 3

Views

Author

Michel Lagneau, May 27 2012

Keywords

Comments

7^p - 6^p - 1 is divisible by 1806p = 6*7*43*p where p prime > 3 (see the proof with the general case).
The sequence is generalizable with the form a(n) = ((k^p - (k-1)^p - 1)) /(k*(k-1)*p*q) where p = prime(n), k integer such that q = k*(k-1) + 1 prime (q = A002383(n) with k = A055494(n)).
k*(k-1)*p*q divides k^p - (k-1)^p - 1, proof :
(1) p divides k^p - (k-1)^p - 1 (Fermat’s theorem)
(2) k*(k-1) divides k^p - (k-1)^p - 1
(3) q = k*(k-1) + 1 divides k^p - (k-1)^p - 1. Suppose k^p - (k-1)^p - 1 ==r (mod q). Then ((k-1)^p)*k^p - ((k-1)^p)*(k-1)^p - (k-1)^p ==r*(k-1)^p (mod q). But the first term is congruent to -1 (mod q), the second term is congruent to k^p (mod q) and the last term is congruent to (k-1)^p (mod q). We obtain r (mod q) = r*(k-1)^p (mod q) => r = 0.

Crossrefs

Programs

  • Maple
    with(numtheory): for n from 3 to 25 do:p:=ithprime(n):x:=(7^p - 6^p - 1)/(1806*p): printf(`%d, `, x):od:
  • PARI
    a(n)={my(p=prime(n)); (7^p - 6^p - 1)/(1806*p)} \\ Andrew Howroyd, Feb 25 2018

A258185 Primes p such that p^2 - q + 1 is prime, where p, q are consecutive primes and p

Original entry on oeis.org

2, 3, 5, 11, 17, 29, 71, 101, 149, 197, 269, 419, 523, 599, 617, 641, 683, 761, 857, 997, 1061, 1063, 1091, 1151, 1201, 1277, 1289, 1409, 1531, 1571, 1607, 1753, 1789, 1987, 2027, 2039, 2111, 2129, 2161, 2267, 2309, 2339, 2503, 2687, 2753, 2999, 3049, 3067, 3257
Offset: 1

Views

Author

K. D. Bajpai, May 23 2015

Keywords

Examples

			a(4) = 11 is prime: 13 is next prime. 11^2 - 13 + 1 = 109 which is also prime.
a(5) = 17 is prime: 19 is next prime. 17^2 - 19 + 1 = 271 which is also prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..10^4] | IsPrime(n) and IsPrime(n^2 - NextPrime(n) +1)]; // Vincenzo Librandi, May 23 2015
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[#^2 - NextPrime[#] + 1] &]
    Select[Partition[Prime[Range[500]],2,1],PrimeQ[#[[1]]^2-#[[2]]+1]&][[All,1]] (* Harvey P. Dale, Sep 06 2016 *)
  • PARI
    c=0; forprime(p = 1,1e6, if(isprime(p^2 - nextprime(p+1) + 1), c++; print(c,"  ",p)))
    

Extensions

Definition clarified by Harvey P. Dale, Sep 06 2016

A260561 Numbers n such that (n^41+1)/(n+1) is prime.

Original entry on oeis.org

61, 63, 99, 144, 230, 312, 360, 401, 413, 424, 451, 515, 542, 567, 610, 618, 622, 651, 690, 732, 817, 871, 1007, 1100, 1156, 1278, 1403, 1427, 1460, 1535, 1572, 1604, 1681, 1742, 1802, 1820, 1847, 1903, 1910, 1913, 1978, 2019, 2104, 2134, 2152, 2169, 2309, 2383
Offset: 1

Views

Author

Tim Johannes Ohrtmann, Jul 29 2015

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..10000] |IsPrime((n^41 + 1) div (n + 1))]
  • Mathematica
    Select[Range[1, 10000], PrimeQ[(#^41 + 1)/(# + 1)] &]
  • PARI
    for(n=1,10000, if(isprime((n^41+1)/(n+1)), print1(n,", ")))
    

A260562 Numbers n such that (n^43+1)/(n+1) is prime.

Original entry on oeis.org

2, 3, 6, 22, 59, 83, 91, 95, 120, 148, 195, 196, 201, 247, 252, 264, 315, 360, 378, 458, 555, 680, 792, 893, 1025, 1088, 1158, 1171, 1240, 1280, 1416, 1437, 1632, 1661, 1677, 1681, 1849, 1946, 1960, 2007, 2090, 2092, 2225, 2242, 2244, 2377, 2483, 2547, 2596, 2641
Offset: 1

Views

Author

Tim Johannes Ohrtmann, Jul 29 2015

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..10000] |IsPrime((n^43 + 1) div (n + 1))]
  • Mathematica
    Select[Range[1, 10000], PrimeQ[(#^43 + 1)/(# + 1)] &]
  • PARI
    for(n=1,10000, if(isprime((n^43+1)/(n+1)), print1(n,", ")))
    

A260563 Numbers n such that (n^47+1)/(n+1) is prime.

Original entry on oeis.org

6, 7, 17, 90, 126, 139, 143, 257, 293, 295, 319, 387, 482, 519, 603, 720, 819, 884, 896, 903, 905, 921, 952, 954, 956, 1042, 1058, 1147, 1170, 1237, 1253, 1279, 1295, 1343, 1366, 1370, 1406, 1465, 1514, 1593, 1595, 1607, 1609, 1622, 1701, 1705, 1709, 1736, 1772
Offset: 1

Views

Author

Tim Johannes Ohrtmann, Jul 29 2015

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..10000] |IsPrime((n^47 + 1) div (n + 1))]
  • Mathematica
    Select[Range[1, 10000], PrimeQ[(#^47 + 1)/(# + 1)] &]
  • PARI
    for(n=1,10000, if(isprime((n^47+1)/(n+1)), print1(n,", ")))
    
Previous Showing 21-30 of 38 results. Next