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 11-16 of 16 results.

A024700 a(n) = (prime(n+2)^2 - 1)/3.

Original entry on oeis.org

8, 16, 40, 56, 96, 120, 176, 280, 320, 456, 560, 616, 736, 936, 1160, 1240, 1496, 1680, 1776, 2080, 2296, 2640, 3136, 3400, 3536, 3816, 3960, 4256, 5376, 5720, 6256, 6440, 7400, 7600, 8216, 8856, 9296, 9976, 10680, 10920, 12160, 12416, 12936, 13200, 14840, 16576, 17176
Offset: 1

Views

Author

Clark Kimberling, Dec 11 1999

Keywords

Comments

Numbers of the form 4*h*(3*h +- 1). - Vincenzo Librandi, May 21 2013
This sequence is also: Numbers n such that k is prime and its square is of the form 3*n + 1 (i.e., k^2 = 3*n + 1). For this case, the sequence is to be prepended with a(0) = 1. - G. C. Greubel, Sep 18 2016

Crossrefs

Programs

  • Magma
    [(NthPrime(n+2)^2-1)/3: n in [1..50]]; // Bruno Berselli, May 22 2013
    
  • Mathematica
    Select[Range[2,10000], PrimeQ[Sqrt[3*#+1]] &] (* G. C. Greubel, Sep 18 2016 *)
    (Prime[Range[3,50]]^2-1)/3 (* Harvey P. Dale, May 05 2022 *)
  • PARI
    a(n) = (prime(n+2)^2-1)/3; \\ Altug Alkan, Sep 18 2016
    
  • SageMath
    [(n^2 -1)/3 for n in prime_range(4,301)] # G. C. Greubel, May 02 2024

Formula

a(n) = (A001248(n+2) - 1)/3. - Elmo R. Oliveira, Jan 20 2023
a(n) = 8*A024702(n+2) = 4*A081115(n+2) = 2*A084922(n+2) = (2/3)*A084921(n) = (4/3)*A024701(n+1) = (8/3)*A061066(n+2). - Alois P. Heinz, Jan 20 2023

A166011 Least common multiple of prime(n)-3 and prime(n)+3.

Original entry on oeis.org

5, 0, 8, 20, 56, 80, 140, 176, 260, 416, 476, 680, 836, 920, 1100, 1400, 1736, 1856, 2240, 2516, 2660, 3116, 3440, 3956, 4700, 5096, 5300, 5720, 5936, 6380, 8060, 8576, 9380, 9656, 11096, 11396, 12320, 13280, 13940, 14960, 16016, 16376, 18236, 18620
Offset: 1

Views

Author

Keywords

Comments

From Altug Alkan, Apr 22 2016: (Start)
For n > 1, a(n) is (p-3)*(p+3)/2 where p is the n-th prime. The reason is that the greatest common divisor of p-3 and p+3 is always 2 where p is the n-th prime and n > 2.
Proof: Let us assume that q is the greatest common divisor of p-3 and p+3. Because of the fact that any divisor of a and b must divide a-b, we know that q must divide 6. Note that q cannot be a multiple of 3 because p is prime, that is, q must be 1 or 2. Since we know that p-3 and p+3 are always even numbers for odd prime p, q must be 2 because we define it as the greatest common divisor.
If the greatest common divisor of p-3 and p+3 is always 2 where p is the n-th prime and n > 2, then the least common multiple of p-3 and p+3 must be (p-3)*(p+3)/2 where p is the n-th prime and n > 2 because of the general identity lcm(a, b) * gcd(a, b) = a*b. Note that for p = 3, (p-3)*(p+3)/t always is equal to 0 for any nonzero integer t, so it can be said that a(n) is (p-3)*(p+3)/2 where p is the n-th prime and n > 1. (End)

Crossrefs

Programs

  • Maple
    A166011:=n->lcm(ithprime(n)+3,ithprime(n)-3): seq(A166011(n), n=1..100); # Wesley Ivan Hurt, Apr 22 2016
  • Mathematica
    f[n_]:=LCM[n-3,n+3]; lst={};Do[p=Prime[n];AppendTo[lst,f[p]],{n,5!}]; lst
    LCM[#+3,#-3]&/@Prime[Range[50]] (* Harvey P. Dale, Aug 09 2015 *)
  • PARI
    a(n) = lcm(prime(n)-3, prime(n)+3); \\ Michel Marcus, Apr 22 2016

A281680 a(0)=1; for n > 0, if 2n+1 is prime, then a(n)=1, otherwise a(n) = (2n+1)/(largest proper divisor of 2n+1).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 5, 3, 1, 1, 3, 5, 1, 3, 1, 1, 3, 1, 7, 3, 1, 5, 3, 1, 1, 3, 5, 1, 3, 1, 1, 3, 7, 1, 3, 1, 5, 3, 1, 7, 3, 5, 1, 3, 1, 1, 3, 1, 1, 3, 1, 5, 3, 7, 11, 3, 5, 1, 3, 1, 7, 3, 1, 1, 3, 11, 5, 3, 1, 1, 3, 5, 1, 3, 7, 1, 3, 1, 13, 3, 1
Offset: 0

Views

Author

Enrique Navarrete, Jan 26 2017

Keywords

Comments

First occurrence of the k-th prime for k = 2, 3, 4, ... is at n = 4, 12, 24, 60, 84, 144, 180, 264, 420, 480, 684, 840, 924, 1104, etc.; This appears to be either A084921 or A216244. - Robert G. Wilson v, Feb 03 2017

Crossrefs

Programs

  • Maple
    f:= proc(n) if isprime(2*n+1) then 1 else min(numtheory:-factorset(2*n+1)) fi end proc:
    f(0):= 1:
    map(f, [$0..100]); # Robert Israel, Aug 03 2020
  • Mathematica
    f[n_] := If[ PrimeQ[2n +1], 1, FactorInteger[2n +1][[1, 1]]]; f[0] = 1; Array[f, 87, 0] (* Robert G. Wilson v, Jan 31 2017 *)
  • PARI
    a(n) = if (n==0, 1, if (isprime(o=2*n+1), 1, d=divisors(o); o/d[#d-1])); \\ Michel Marcus, Feb 02 2017

A140384 Consecutive triples (x=(p^2-1)/2,2*p,y=z=(p^2+1)/2), p prime, representing isosceles triangles with sides (x,y,z).

Original entry on oeis.org

4, 6, 5, 12, 10, 13, 24, 14, 25, 60, 22, 61, 84, 26, 85, 144, 34, 145, 180, 38, 181, 264, 46, 265, 420, 58, 421, 480, 62, 481, 684, 74, 685, 840, 82, 841, 924, 86, 925, 1104, 94, 1105, 1404, 106, 1405, 1740, 118, 1741, 1860, 122, 1861, 2244, 134, 2245, 2520, 142
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 13 2008

Keywords

Comments

Or: Triples A084921(i), A100484(i), A066885(i), i=2,3... in compound order.

Extensions

Edited by R. J. Mathar, Jun 16 2008 and Jun 17 2008

A286328 Least integer k such that the area of the triangle (prime(n), k, k+1) is an integer.

Original entry on oeis.org

4, 3, 24, 60, 14, 9, 180, 264, 20, 480, 19, 84, 924, 1104, 51, 1740, 155, 2244, 2520, 2664, 3120, 3444, 99, 51, 51, 5304, 5724, 65, 399, 8064, 8580, 9384, 9660, 221, 11400, 12324, 13284, 13944, 14964, 16020, 819, 18240, 194, 99, 19800, 22260, 24864, 25764, 26220
Offset: 2

Views

Author

Michel Lagneau, May 07 2017

Keywords

Comments

The area A of a triangle whose sides have lengths a, b, and c is given by Heron's formula : A = sqrt(s*(s-a)*(s-b)*(s-c)), where s = (a+b+c)/2.
The corresponding areas are 6, 6, 84, 330, 84, 36, 1710, 3036, 210,...
The following table gives the first values of n, the sides (prime(n), k, k+1) and the area A of each triangle.
+-----+---------+------+------+-------+
| n | prime(n)| k | k+1 | A |
+-----+---------+------+------+-------+
| 2 | 3 | 4 | 5 | 6 |
| 3 | 5 | 3 | 4 | 6 |
| 4 | 7 | 24 | 25 | 84 |
| 5 | 11 | 60 | 61 | 330 |
| 6 | 13 | 14 | 15 | 84 |
| 7 | 17 | 9 | 10 | 36 |
| 8 | 19 | 180 | 181 | 1710 |
| 9 | 23 | 264 | 265 | 3036 |
| 10 | 29 | 20 | 21 | 210 |
.......................................
We observe triangles of sides (prime(m), prime(m)+1, prime(m)+2) = (3, 4, 5), (13, 14, 15), (193, 194, 195), (37633, 37634, 37635), ... with the corresponding areas 6, 84, 16296, 613283664, ... (subsequence of A011945).
We observe Pythagorean triangles for n = 2, 3, 4, 5, 8, 9, 10, ....
In this case, if prime(n) < k, the numbers k of the sequence such that prime(n) = sqrt(2k+1) are given by the numbers {4, 24, 60, 180, 264, ...}, subsequence of {A084921} = {4, 12, 24, 60, 84, 144, 180, 264, ...}. If prime(n) > k, the numbers k of the sequence such that prime(n) = sqrt(2k^2+2k+1) are given by the numbers 3, 20, 4059, 23660, ....
From Chai Wah Wu, May 15 2017: (Start)
Assumes triangle has positive area.
Let p = prime(n). Then
(p+1)/2 <= a(n) <= (p^2-1)/2.
a(n) = (p+1)/2 if n > 1 is a term in A062325, i.e. p is of the form m^2+1 (A002496); otherwise, a(n) > (p+1)/2.
a(n) is the smallest k >= (p+1)/2 such that sum_{i=(p+1)/2}^{k} i*(p^2-1)/2 is a square.
These statements follow from the fact that the area of a triangle with sides of length p, k and k+1 is equal to (p^2-1)*((2k+1)^2-p^2)/16.
(End)

Examples

			a(4) = 24 because the area of the triangle (prime(4), 24, 25) = (7, 24, 25) = sqrt(28*(28-7)*(28-24)*(28-25)) = 84, where the semiperimeter 28 = (7+24+25)/2.
		

Crossrefs

Programs

  • Maple
    nn:=10^7:
    for n from 2 to 50 do:
    a:=ithprime(n):ii:=0:
    for k from 1 to nn while(ii=0) do:
    p:=(a+2*k+1)/2:q:=p*(p-a)*(p-k)*(p-k-1):
    if q>0 and floor(sqrt(q))=sqrt(q) then
           ii:=1: printf(`%d, `,k):
          else
          fi:
         od:
        od:
  • Mathematica
    Do[kk=0;Do[s=(Prime[n]+2k+1)/2;If[IntegerQ[s],area2=s(s-Prime[n])(s-k)(s-k-1);If[area2>0&&kk==0&&IntegerQ[Sqrt[area2]],Print[n," ",k];kk=1]],{k,1,3*10^4}],{n,2,10}] (* or *)
    a[n_] := Block[{p = Prime@n, k}, k = (p + 1)/2; While[! IntegerQ@ Sqrt[(4 k^2 - p^2 + 4 k + 1) (p^2 - 1)/16], k++]; k]; a /@ Range[2, 50] (* Giovanni Resta, May 07 2017 *)
  • Python
    from _future_ import division
    from sympy import prime
    from gmpy2 import is_square
    def A286328(n): # assumes n >= 2
        p, area = prime(n), 0
        k, q, kq = (p + 1)//2, (p**2 - 1)//2, (p - 1)*(p + 1)**2//4
        while True:
            area += kq
            if is_square(area):
                return k
            k += 1
            kq += q # Chai Wah Wu, May 15 2017

A306353 Number of composites among the first n composite numbers whose least prime factor p is that of the n-th composite number.

Original entry on oeis.org

1, 2, 3, 1, 4, 5, 6, 2, 7, 8, 9, 3, 10, 11, 1, 12, 4, 13, 14, 15, 5, 16, 2, 17, 18, 6, 19, 20, 21, 7, 22, 23, 1, 24, 8, 25, 26, 3, 27, 9, 28, 29, 30, 10, 31, 4, 32, 33, 11, 34, 35, 36, 12, 37, 2, 38, 39, 13, 40, 41, 5, 42, 14, 43, 44, 3, 45, 15, 46, 6, 47, 48, 16, 49, 50, 51, 17, 52, 53, 54, 18, 55, 56, 7
Offset: 1

Views

Author

Jamie Morken and Vincenzo Librandi, Feb 09 2019

Keywords

Comments

Composites with least prime factor p are on that row of A083140 which begins with p
Sequence with similar values: A122005.
Sequence written as a jagged array A with new row when a(n) > a(n+1):
1, 2, 3,
1, 4, 5, 6,
2, 7, 8, 9,
3, 10, 11,
1, 12,
4, 13, 14, 15,
5, 16,
2, 17, 18,
6, 19, 20, 21,
7, 22, 23,
1, 24,
8, 25, 26,
3, 27,
9, 28, 29, 30.
A153196 is the list B of the first values in successive rows with length 4.
B is given by the formula for A002808(x)=A256388(n+3), an(x)=A153196(n+2)
For example: A002808(26)=A256388(3+3), an(26)=A153196(3+2).
A243811 is the list of the second values in successive rows with length 4.
A047845 is the list of values in the second column and A104279 is the list of values in the third column of the jagged array starting on the second row.
Sequence written as an irregular triangle C with new row when a(n)=1:
1,2,3,
1,4,5,6,2,7,8,9,3,10,11,
1,12,4,13,14,15,5,16,2,17,18,6,19,20,21,7,22,23,
1,24,8,25,26,3,27,9,28,29,30,10,31,4,32,33,11,34,35,36,12,37,2,38,39,13,40,41,5,42,14,43,44,3,45,15,46,6,47,48,16,49,50,51,17,52,53,54,18,55,56,7,57,19,58,4,59.
A243887 is the last value in each row of C.
The second value D on the row n > 1 of the irregular triangle C is a(A053683(n)) or equivalently A084921(n). For example for row 3 of the irregular triangle:
D = a(A053683(3)) = a(16) = 12 or D = A084921(3) = 12. This is the number of composites < A066872(3) with the same least prime factor p as the A053683(3) = 16th composite, A066872(3) = 26.
The number of values in each row of the irregular triangle C begins: 3,11,18,57,39,98,61,141,265,104,351,268,...
The second row of the irregular triangle C is A117385(b) for 3 < b < 15.
The third row of the irregular triangle C has similar values as A117385 in different order.

Examples

			First composite 4, least prime factor is 2, first case for 2 so a(1)=1.
Next composite 6, least prime factor is 2, second case for 2 so a(2)=2.
Next composite 8, least prime factor is 2, third case for 2 so a(3)=3.
Next composite 9, least prime factor is 3, first case for 3 so a(4)=1.
Next composite 10, least prime factor is 2, fourth case for 2 so a(5)=4.
		

Crossrefs

Programs

  • Mathematica
    counts = {}
    values = {}
    For[i = 2, i < 130, i = i + 1,
    If[PrimeQ[i], ,
    x = PrimePi[FactorInteger[i][[1, 1]]];
      If[Length[counts] >= x,
       counts[[x]] = counts[[x]] + 1;
       AppendTo[values, counts[[x]]], AppendTo[counts, 1];
       AppendTo[values, 1]]]]
       (* Print[counts] *)
       Print[values]
  • PARI
    c(n) = for(k=0, primepi(n), isprime(n++)&&k--); n; \\ A002808
    a(n) = my(c=c(n), lpf = vecmin(factor(c)[,1]), nb=0); for(k=2, c, if (!isprime(k) && vecmin(factor(k)[,1])==lpf, nb++)); nb; \\ Michel Marcus, Feb 10 2019

Formula

a(n) is approximately equal to A002808(n)*(A038110(x)/A038111(x)), with A000040(x)=A020639(A002808(n)).
For example if n=325, a(325)~= A002808(325)*(A038110(2)/A038111(2)) with A000040(2)=A020639(A002808(325)).
This gives an estimate of 67.499... and the actual value of a(n)=67.
Previous Showing 11-16 of 16 results.