login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A157939 Numbers n divisible by precprime(sqrt(n)) or nextprime(sqrt(n)) but not both, where precprime=A007917, nextprime=A007918. 1
8, 10, 12, 18, 20, 21, 24, 28, 30, 40, 42, 45, 55, 56, 63, 66, 70, 84, 88, 91, 98, 99, 105, 110, 112, 119, 130, 132, 154, 156, 165, 170, 182, 187, 195, 204, 208, 234, 238, 247, 255, 260, 272, 273, 286, 304, 306, 340, 342, 357, 368, 380, 391, 399, 414, 418, 456 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Equal to the union of its disjoint subsequences A157938 and A157940.
LINKS
Project Euler, Problem 234: Semidivisible numbers, Feb 28 2009
FORMULA
A157939 = A157938 union A157940 = A157937 /\ A157941 = A157936 /\ A157942, where A /\ B = (A u B) \ (A n B) = (A \ B) u (B \ A) is the symmetric difference; A157937 intersect A157941 = A006094 = (A157936 intersect A157942) \ A001248.
EXAMPLE
For n=1,2,3, precprime(sqrt(n)) is undefined, so these are not considered here. a(1) = 8 is divisible by 2=precprime(sqrt(8)) but not by 3=nextprime(sqrt(8)).
a(2) = 10 is divisible by 5=nextprime(sqrt(10)) but not by 3=precprime(sqrt(8)).
n=4,6,9,... are excluded since divisible by both precprime(sqrt(n)) and nextprime(sqrt(n)). (Note that precprime=A007917 and nextprime=A007918 are defined using weak inequalities.) n=5,7,11,13 but also 14 are excluded since not divisible by precprime(sqrt(n)) nor by nextprime(sqrt(n)).
MATHEMATICA
ndQ[n_]:=Module[{s=Sqrt[n]}, Total[Boole[{Divisible[n, NextPrime[ s]], Divisible[ n, NextPrime[ s, -1]]}]]==1]; Select[Range[5, 500], ndQ] (* Harvey P. Dale, Mar 19 2019 *)
PROG
(PARI) for( n=4, 999, !(n % nextprime(sqrtint(n-1)+1)) != !(n % precprime(sqrtint(n))) & print1(n", ")) /* sqrtint(n-1)+1 avoids rounding errors but can be replaced by sqrt(n) for small n */
CROSSREFS
Sequence in context: A249628 A352169 A158273 * A208154 A096281 A114873
KEYWORD
nonn
AUTHOR
M. F. Hasler, Mar 10 2009
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 19 06:32 EDT 2024. Contains 374389 sequences. (Running on oeis4.)