高校数学の質問スレ(医者・東大卒専用) Part438 (979レス)
高校数学の質問スレ(医者・東大卒専用) Part438 http://rio2016.5ch.net/test/read.cgi/math/1723152147/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
227: 132人目の素数さん [sage] 2024/09/28(土) 08:42:02.91 ID:XCswu5aK a,b,cは100以下の相異なる正の整数でa<b<cとする。 4つの整数a+b-c,b+c-a,c+a-b,a+b+cのすべてが素数となるような組合せは何個あるか数えよ。 rm(list=ls()) library(numbers) n=100 ans=NULL for(a in 1:(n-2)){ for(b in (a+1):(n-1)){ for(c in (b+1):n){ x= a+b-c y= b+c-a z= c+a-b if(x>0 & y>0 & z>0){ if(isPrime(x) & isPrime(y) & isPrime(z)){ ans=rbind(ans,c(a,b,c,x,y,z)) } } } } } ans colnames(ans)=c('a','b','c','a+b-c','b+c-a','c+a-b') head(ans) tail(ans) abc=ans[,1:3] xyz=ans[,4:6] abc[rowSums(abc)==max(rowSums(abc)),] abc[rowSums(abc)==min(rowSums(abc)),] ans4=abc[isPrime(rowSums(abc)),] head(ans4) tail(ans4) http://rio2016.5ch.net/test/read.cgi/math/1723152147/227
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.046s